去重(distinct
只需要在查询的字段前加上distinct
+号的作用只能做运算符
拼接字段(concat)
between and
in 判断某字段的值是否属于in列表中的一项
is null is not null 则相反
这里不等于一个值要用<>
ifnull 如果commission_pct为空,则是0
面试1
asc desc(降序) 默认升序,不用写
length 按长度
order by
sql语言索引都是从1开始的
大小写
字符截取
instr(返回子串第一次出现的索引)
日期
流程控制语句(if) 相当于三元运算符
case 和swith 语句类似
having 分组后进行筛选
链接查询
原文:https://www.cnblogs.com/xiaoayu/p/12315151.html