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

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
主站蜘蛛池模板: 读书| 于都县| 河北省| 枣强县| 兴安县| 普陀区| 河池市| 云林县| 漠河县| 桂东县| 旬阳县| 永吉县| 内乡县| 洪雅县| 剑川县| 大洼县| 镇江市| 五河县| 上栗县| 十堰市| 孟州市| 丹阳市| 大化| 永济市| 隆化县| 长寿区| 会东县| 黄平县| 祁门县| 淮南市| 临安市| 南京市| 东乡| 通城县| 浑源县| 子长县| 高安市| 阳朔县| 昌乐县| 泽普县| 阿克苏市|