sql 学习笔记
grammar
执行顺序:
from
where
group by
having
select
distinct
union
order by
group by
使用分组语句,select 语句后面只能出现分组字段和聚合函数
where
andhaving
where 用在对 from 后的操作,对行的操作
having 用在对 group by 语句后的操作
like
%
匹配任意多个字符
_
匹配任意 1 个字符
'xx%':xx 开头
'%xx%':包含 xx
'xx_':xx 后面 1 个字
distinct
`distinct column_name`
count(distinct, column_name)
create
drop
insert
评论