Select
用途:
从指定表中取出指定的列的数据
语法:
SELECT column_name(s) FROM table_name
例:
“Persons” 表中的数据有
LastName | FirstName | Address | City |
Hansen | Ola | Timoteivn 10 | Sandnes |
Svendson | Tove | Borgvn 23 | Sandnes |
Pettersen | Kari | Storgt 20 | Stavanger |
选出字段名” LastName”、” FirstName” 的数据
SELECT LastName,FirstName FROM Persons
返回结果:
LastName | FirstName |
Hansen | Ola |
Svendson | Tove |
Pettersen | Kari |
选出所有字段的数据
SELECT * FROM Persons
返回结果:
LastName | FirstName | Address | City |
Hansen | Ola | Timoteivn 10 | Sandnes |
Svendson | Tove | Borgvn 23 | Sandnes |
Pettersen | Kari | Storgt 20 | Stavanger |