mysql 语法

查询所有列

seletc * from 表名;

查询指定的列

select * from 表名 where 条件

查询时添加常亮列

select  cname as"名字"  from 表名

查询时合并

select (js+html) from 表名  

 select (js+html) as"成绩" from 表名

查询时去重  distinct:去重

select distinct 字段 from 表名 

 

条件查询  逻辑条件 and  or

比较条件  < > <= >=    <>(不等于)  !=(不等于)

 

 null 值就是空的什么都没有 ,但是空值就有值的,空值只能是字符串“ ”,空的值

 

模糊查询  like %

select * from where 姓名 like “值%”

猜你喜欢

转载自www.cnblogs.com/wangrongchen/p/8990006.html
今日推荐