LIKE Syntax
SELECT column1, column2, ...
FROM table_name
WHERE columnN LIKE pattern;
FROM table_name
WHERE columnN LIKE pattern;
Example
SELECT * FROM Customers
WHERE CustomerName LIKE 'a%';
WHERE CustomerName LIKE 'a%';
SELECT * FROM Customers
WHERE CustomerName LIKE '%a';
WHERE CustomerName LIKE '%a';
SELECT * FROM Customers
WHERE CustomerName LIKE '%or%';
WHERE CustomerName LIKE '%or%';
SELECT * FROM Customers
WHERE CustomerName LIKE '_r%';
WHERE CustomerName LIKE '_r%';
SELECT * FROM Customers
WHERE CustomerName LIKE 'a__%';
WHERE CustomerName LIKE 'a__%';
SELECT * FROM Customers
WHERE ContactName LIKE 'a%o';
WHERE ContactName LIKE 'a%o';
SELECT * FROM Customers
WHERE CustomerName NOT LIKE 'a%';
WHERE CustomerName NOT LIKE 'a%';
No comments:
Post a Comment
Thank You..