SQL Comparison Keywords Explanation with Example

Prabhukiran345
Posted by Prabhukiran345 under Sql Server category on | Points: 40 | Views : 487
SQL LIKE Operator:The LIKE operator is used to list all rows in a table whose column values match a specified pattern.
Example:
SELECT first_name, last_name 
FROM student_details
WHERE first_name LIKE 'S%';

SQL BETWEEN ... AND Operator The operator BETWEEN and AND, are used to compare data for a range of values.
Example:

SELECT first_name, last_name, age 
FROM student_details
WHERE age BETWEEN 10 AND 15;

SQL IN Operator:The IN operator is used when you want to compare a column with more than one value.
Example:
SELECT first_name, last_name, subject 
FROM student_details
WHERE subject IN ('Maths', 'Science')

Comments or Responses

Login to post response