记录SQL基础
//查询所有
SELECT * FROM table_name
//查询某列
SELECT column1,column2... FROM table_name
//查询某列不同的值
SELECT DISTINCT column1,column2... FROM table_name
//查询前几条数据
SELECT * FROM table_name LIMIT 5
//查询以G开头的数据
SELECT * FROM table_name WHERE name LIKE 'G%'
//查询某个区间的值
SELECT * FROM table_name WHERE id=1
SELECT * FROM table_name WHERE id BETWEEN 1 AND 10
SELECT * FROM table_name WHERE id IN (1,10)
//排序
SELECT * FROM table_name ORDER BY id DESC/ASC
//插入值
INSERT INTO table_name(column1,column2...) VALUES (value1,value2...)
//修改
UPDATE table_name SET column1=value1,column2=value2 WHERE id=1
//删除
DELETE FROM table_name WHERE id=1