mysql 语法

Posted 呐呐呐那

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 “值%”

 

以上是关于mysql 语法的主要内容,如果未能解决你的问题,请参考以下文章