Server version: 5.6.47 MySQL Community Server (GPL)
1.检索单个列
SELECT prod_name FROM Products;
2.检索多个列
SELECT prod_id,prod_name,prod_price FROM Products;
3.检索所有列
SELECT * FROM Products;
4.检索不同的值
SELECT vend_id FROM Products;
SELECT DISTINCT vend_id FROM Products;
5.限制结果
SELECT prod_name FROM Products LIMIT 5;
SELECT prod_name FROM Products LIMIT 5 OFFSET 5;
6.使用注释
SELECT prod_name FROM Products; -- 这是一条注释
# 这是一条注释
/* 多行注释 */