SQL Select Statement
The SELECT statement is used to select data from a database.
SQL
Select Syntax
SELECT column_name(s) FROM table_name |
SQL SELECT Example:
“Persons” TABLE:
P_Id
|
LastName
|
FirstName
|
Address
|
City
|
1
|
Suhail
|
Osmani
|
Maharaj
Nagar
|
Sitapur
|
2
|
Maxwel
|
Tom
|
Biswan
|
Sitapur
|
3
|
Rahi
|
Ayon
|
Okhla
|
Delhi
|
SELECT LastName,FirstName
FROM Persons
|
LastName
|
FirstName
|
Suhail
|
Osmani
|
Maxwel
|
Tom
|
Rahi
|
Ayon
|
Note: SELECT * select all the columns from “Persons” TABLE. The asterisk (*) is a quick way of selecting all columns!
We use the following SELECT statement:
SELECT
* FROM Persons
|
P_Id
|
LastName
|
FirstName
|
Address
|
City
|
1
|
Suhail
|
Osmani
|
Maharaj
Nagar
|
Sitapur
|
2
|
Maxwel
|
Tom
|
Biswan
|
Sitapur
|
3
|
Rahi
|
Ayon
|
Okhla
|
Delhi
|
SQL Select Statement
Reviewed by Admin
on
04:54:00
Rating:
No comments: