The SELECT statement is used to select data from a database table or view or ....
The data returned is shown in a result table, (result-set).
this table is the result of select command
SELECT Syntax
for the field names of the table you want to select data from we use:
SELECT column1, column2,column3, ...
FROM table_name
for select all the fields of table, we use the following syntax:
SELECT * FROM table_name
examples:
we have a tbl_Members on database as following details :
+ tbl_Members
- userID
- UserName
- eMail
- SignUpDate
SELECT Columns Example:
The following SQL statement selects the "eMail" and "SignUpDate" columns from the "tbl_Members" table:
SELECT eMail, SignUpDate FROM tbl_Members
An example for SELECT * :
The following SQL statement selects all the columns in the "tbl_Members" table:
SELECT * FROM tbl_Members