SQL 教程
SELECT 語句用于從數(shù)據(jù)庫中選取數(shù)據(jù)。
SELECT 語句用于從數(shù)據(jù)庫中選取數(shù)據(jù)。
結(jié)果被存儲在一個結(jié)果表中,稱為結(jié)果集。
與
在本教程中,我們將使用 JSON 樣本數(shù)據(jù)庫。
下面是選自 "Websites" 表的數(shù)據(jù):
+----+--------------+---------------------------+-------+---------+ | id | name | url | alexa | country | +----+--------------+---------------------------+-------+---------+ | 1 | Google | https://www.google.cm/ | 1 | USA | | 2 | 淘寶 | https://www.taobao.com/ | 13 | CN | | 3 | 小白教程 | http://9t9t.com.cn | 888 | CN | | 4 | 微博 | http://weibo.com/ | 20 | CN | | 5 | Facebook | https://www.facebook.com/ | 3 | USA | +----+--------------+---------------------------+-------+---------+
下面的 SQL 語句從 "Websites" 表中選取 "name" 和 "country" 列:
下面的 SQL 語句從 "Websites" 表中選取所有列:
大多數(shù)數(shù)據(jù)庫軟件系統(tǒng)都允許使用編程函數(shù)在結(jié)果集中進(jìn)行導(dǎo)航,比如:Move-To-First-Record、Get-Record-Content、Move-To-Next-Record 等等。
類似這些編程函數(shù)不在本教程講解之列。如需學(xué)習(xí)通過函數(shù)調(diào)用訪問數(shù)據(jù)的知識,請訪問我們的 ADO 教程 或者 PHP 教程。