2018-11-27
閱讀量:
848
查詢表中的數(shù)據(jù)
select 語句常用來根據(jù)一定的查詢規(guī)則到數(shù)據(jù)庫中獲取數(shù)據(jù), 其基本的用法為:
select 列名稱 from 表名稱 [查詢條件];
例如要查詢 students 表中所有學(xué)生的名字和年齡, 輸入語句 select name, age from students; 執(zhí)行結(jié)果如下:
mysql> select name, age from students;
+--------+-----+
| name | age |
+--------+-----+
| 王剛 | 20 |
| 孫麗華 | 21 |
| 王永恒 | 23 |
| 鄭俊杰 | 19 |
| 陳芳 | 22 |
| 張偉朋 | 21 |
+--------+-----+
6 rows in set (0.00 sec)
mysql>
也可以使用通配符 * 查詢表中所有的內(nèi)容, 語句: select * from students;






評論(0)


暫無數(shù)據(jù)
推薦帖子
0條評論
1條評論
0條評論