http://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all ------------------------------- like ªí: Customers SELECT * FROM Customers WHERE City LIKE 's%'; SELECT * FROM Customers WHERE City LIKE '%s'; SELECT * FROM Customers WHERE City LIKE '%s%'; SELECT * FROM Customers WHERE Country LIKE '%land%'; SELECT * FROM Customers WHERE Country NOT LIKE '%land%'; ------------------------ in ªí Customers SELECT City,ContactName FROM Customers WHERE City IN ('Paris','London'); ------------------------ between ªí Products, Employees SELECT * FROM Products WHERE Price BETWEEN 10 AND 14; SELECT EmployeeID, FirstName FROM Employees Where FirstName BETWEEN 'A' and 'B'; --------------------------- DISTINCT SELECT DISTINCT Country FROM Suppliers; ------------------------------------ avg(), count(), max() SELECT AVG(Price) FROM Products; SELECT AVG(Price) AS PriceAverage FROM Products; SELECT MIN(Price) FROM Products WHERE CategoryID IN (1,2); SELECT AVG(Price) FROM Products; SELECT ProductName, Price FROM Products WHERE Price>(SELECT AVG(Price) FROM Products); ------------------------------------ group by + avg(), count(), max(), Suppliers SELECT Country, COUNT(*) FROM Suppliers GROUP BY Country ORDER SELECT SupplierID, COUNT(*) FROM Products GROUP BY SupplierID SELECT SupplierID, AVG(Price) FROM Products GROUP BY SupplierID SELECT SupplierID, MAX(Price) FROM Products GROUP BY SupplierID SELECT City,COUNT(*) FROM Customers GROUP BY City