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

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
主站蜘蛛池模板: 东乡县| 连南| 清新县| 双峰县| 建宁县| 五大连池市| 平湖市| 津南区| 云阳县| 顺义区| 商丘市| 任丘市| 南川市| 方山县| 怀集县| 墨脱县| 松溪县| 新龙县| 崇礼县| 常德市| 桐庐县| 湘潭县| 通渭县| 广灵县| 三都| 浦江县| 六盘水市| 罗城| 武清区| 嘉义县| 逊克县| 广元市| 社旗县| 林州市| 昌都县| 基隆市| 馆陶县| 洪洞县| 纳雍县| 冀州市| 武定县|