SQL-select
http://www.w3school.com.cn/sql/sql_select.asp
SQL SELECT语句
SELECT语句用于从表中选取数据。
结果被存储在一个结果表中(称为结果集)。
SQL SELECT语法
SELECT column_name FROM table_name
SELECT * FROM table_name
SQL select实例:
"Persons" 表:
Id | LastName | FirstName | Address | City |
---|---|---|---|---|
1 | Adams | John | Oxford Street | London |
2 | Bush | George | Fifth Avenue | New York |
3 | Carter | Thomas | Changan Street | Beijing |
select LastName, FirstName from Persons
结果
LastName | FirstName |
---|---|
Adams | John |
Bush | George |
Carter | Thomas |
SQL SELECT * 实例
SELECT * FROM Persons
(*是选取所有列的快捷方式)