语句查询
sql条件查询语句
select 字段名 from 表名; 查询某个字段 多个用逗号隔开
select distinct 字段名 from 表名 去重复查询
使用and和or多条件查询:
select 多个字段名 from 表名 where 条件 and 条件;
解:从当前多个字段当中查找符合段判断条件的记录
例:select id,name,age from students where id>3 and age>25;
mysql 区分大小写查询 binary
默认不区分大小写
binary类型运算转换符,用它强制将字符串转换成二进制来区分
select * from 表名 where binary 字段名=字段值;
排序查询:
语法:select字段1,字段2 from 表名order by 字段名;
默认为升序asc: select 字段名 from 表名 order by 字段名 asc;
降序:select 字段名 from 表名 order by 字段名 desc;