官术网_书友最值得收藏!

SELECT

Most of the SQL statements are one-word short and self-explanatory. This statement, for example, is used to select one or more columns from a specific table and to obtain the data from the said columns. Let's check out some of the sample commands that use the SELECT statement.

The following command retrieves all the data of all the columns from the user table:

SELECT * FROM user;

The following command retrieves only the username column from the user table:

SELECT username FROM user;

The following command retrieves the username and password columns from the user table with the condition that the id equals 1:

SELECT username, password FROM user WHERE id = 1;

You can try out these commands by yourself using phpMyAdmin. To do that, click the SQL button located at the top of the menu in phpMyAdmin. After that, you can type the command in the text field below and click Go to execute the query:

To learn more about the SELECT statement, please refer to the following link: 
https://dev.mysql.com/doc/refman/5.7/en/select.html
主站蜘蛛池模板: 巴楚县| 双城市| 高密市| 巴里| 深水埗区| 民勤县| 罗城| 华安县| 乌拉特中旗| 连江县| 尚义县| 剑阁县| 锦州市| 亳州市| 汝南县| 囊谦县| 武宁县| 安宁市| 航空| 青田县| 甘南县| 霍邱县| 龙川县| 板桥市| 新绛县| 齐齐哈尔市| 沙湾县| 勃利县| 泰宁县| 溆浦县| 三都| 台东县| 博野县| 云霄县| 张家口市| 屏边| 大港区| 始兴县| 台北县| 西宁市| 漠河县|