The SELECT statement is used to select data from a database. The result is stored in a result table, called the result-set. You can use the SELECT statement to query information from one ore more tables in a
database. Tables can be joined together to provide relational information. When using the SELECT statement, you can either specify the fields (columns) or use '*' to indicate that the results should include all
fields. SQL is not case sensitive. You can also use the keyword DISTINCT to only request a unique recordset.
SQL SELECT Syntax
SELECT column_name(s)
FROM table_name
|
or
or
SELECT DISTINCT column_name(s)
FROM table_name
|
SQL SELECT Examples
SELECT LastName,FirstName FROM Customers
SELECT DISTINCT LastName FROM Customers
SELECT * FROM tbl_employees
employeeID | employeeName |
1000 | John Smith |
1001 | Fred White |
1002 | Jane Scott |
1003 | Samuel Williams |
Did you find the page informational and useful? Share it using one of your favorite social sites.
Recommended Books & Training Resources