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

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
主站蜘蛛池模板: 彭山县| 监利县| 天柱县| 库车县| 绵阳市| 会理县| 开封市| 屏东市| 芦山县| 罗源县| 读书| 渭源县| 南华县| 衡东县| 财经| 天台县| 温泉县| 赤壁市| 铁岭市| 芮城县| 林州市| 东乡族自治县| 镇平县| 汝州市| 随州市| 崇州市| 清河县| 高邮市| 陆河县| 汽车| 云林县| 博野县| 攀枝花市| 壤塘县| 绥化市| 平阴县| 九江市| 固阳县| 塔城市| 公安县| 黔东|