Like Operator
Advertisements
Like Operator in SQL
Like Operator is used in a WHERE clause to search for a specified pattern in a column. Suppose you want to search those employee record whose name start with H alphabet.
Syntax
SELECT column_name FROM table_name WHERE column_name LIKE pattern;
Employee table
emp_id | name | salary |
---|---|---|
101 | Amit | 24000 |
102 | Rahul | 34000 |
103 | Sultan | 54000 |
104 | Gaurav | 26000 |
105 | Hitesh | 35000 |
Example
SELECT * from Employee WHERE name LIKE 'H%';
Result after using Like Operator.
105 | Hitesh | 35000 |
Google Advertisment