SQL Notes
SQL Notes
com ##
---------------------------------------------
SELECT * FROM Customers WHERE City LIKE 'a%'; ---(starts with 'a')
SELECT * FROM customers WHERE city LIKE '%a'; ---(ends with 'a')
SELECT * FROM customers WHERE city LIKE '%ar%'; ---(has 'ar' anywhere)
SELECT * FROM customers WHERE city LIKE '_o%'; ---(has 'o' at 2nd position)
SELECT * FROM customers WHERE city LIKE 'h%r'; ---(starts with 'h' and ends with
'r')
SELECT * FROM customers WHERE city LIKE 'a__%'; ---(starts with 'a', and has
atleast 3 characters in it)