The best SQL SELECT statement Tutorial In 2024, In this tutorial you can learn SQL SELECT statement,The demo database,SELECT Column examples,Examples,SELECT * Examples,Examples,Result set navigation,
SELECT statement is used to select data from the database.
SELECT statement is used to select data from the database.
The results are stored in a result table, called the result set.
versus
In this tutorial, we will use w3big sample database.
The following is a selected "Websites" table data:
+----+--------------+---------------------------+-------+---------+ | id | name | url | alexa | country | +----+--------------+---------------------------+-------+---------+ | 1 | Google | https://www.google.cm/ | 1 | USA | | 2 | 淘宝 | https://www.taobao.com/ | 13 | CN | | 3 | 本教程 | http://www.w3write.com/ | 4689 | CN | | 4 | 微博 | http://weibo.com/ | 20 | CN | | 5 | Facebook | https://www.facebook.com/ | 3 | USA | +----+--------------+---------------------------+-------+---------+
The following SQL statement select "name" and "country" column from the "Websites" table:
The output is:
The following SQL statement selects all columns from the "Websites" table:
The output is:
The following command output:
Most database software systems allow the use of programming functions to navigate in the result set, for example: Move-To-First-Record, Get-Record-Content, Move-To-Next-Record, and so on.
These columns programming functions that are not of this tutorial to explain the similar. To learn knowledge calls to access the data through a function, please visit our ADO tutorial or PHP tutorial .