how to compare two strings in sql query code example

Example 1: sql compare strings

SELECT * FROM table WHERE Column = 'test';			-- can use index
SELECT * FROM table WHERE Column LIKE '%test%';		-- can't use index
SELECT * FROM table WHERE CONTAINS(Column, 'test'); -- faster with full text index

Example 2: compare strings lexicographically in sql

'ball' < 'water'
  
  if you are looking for solving the question from HyperSkills/expressions then this is what you need(don't forget to use Select statement) :D

Tags:

Sql Example