SELECT column1, column2, columnN
FROM table_name
WHERE condition
+----+----------------+----------------------------+-----+-------+---------+---------+ | id | name | url | age | alexa | uv | country | +----+----------------+----------------------------+-----+-------+---------+---------+ | 1 | 百度 | https://www.baidu.com/ | 21 | 4 | 5010.5 | CN | | 2 | 淘宝 | https://www.taobao.com/ | 17 | 8 | 3996.75 | CN | | 3 | C语言中文网 | http://task.lmcjl.com/ | 12 | 7923 | 11.62 | CN | | 4 | Google | https://www.google.com/ | 23 | 1 | 36474 | US | | 5 | GitHub | https://github.com/ | 13 | 95 | 216.3 | US | | 6 | Stack Overflow | https://stackoverflow.com/ | 16 | 48 | 592.2 | US | | 7 | Yandex | http://www.yandex.ru/ | 11 | 53 | 591.82 | RU | | 8 | VK | https://vk.com/ | 23 | 23 | 1206 | RU | +----+----------------+----------------------------+-----+-------+---------+---------+
SELECT id, name, url, uv FROM website WHERE uv > 800;该语句将得到如下的结果:
+----+--------+-------------------------+---------+ | id | name | url | uv | +----+--------+-------------------------+---------+ | 1 | 百度 | https://www.baidu.com/ | 5010.5 | | 2 | 淘宝 | https://www.taobao.com/ | 3996.75 | | 4 | Google | https://www.google.com/ | 36474 | | 8 | VK | https://vk.com/ | 1206 | +----+--------+-------------------------+---------+
SELECT id, name, url, uv FROM website WHERE uv > 500 AND name LIKE '%o%';该语句将得到如下的结果:
+----+----------------+----------------------------+-------+ | id | name | url | uv | +----+----------------+----------------------------+-------+ | 4 | Google | https://www.google.com/ | 36474 | | 6 | Stack Overflow | https://stackoverflow.com/ | 592.2 | +----+----------------+----------------------------+-------+
本文链接:http://task.lmcjl.com/news/15450.html