常用的sql语句

查找不包含某个字符的记录

  • 查询vtm_order表中的exchangeId字段不包括VTM字符的记录
select * from vtm_order where exchangeId not like '%VTM%'

去除查询结果中字段重复的值

  • 通过分组查看biz_code的一条记录
select * from vtm_log where createTime>'2021-10-01' group by biz_code

查询字段是null的记录

  • 查询null值不能用=,需要使用is
select * from vtm_log where biz_code is null

查看mysql安装位置

show variables like "%char%";

posted @ 2021-11-16 15:12  初夏那片海  阅读(44)  评论(0)    收藏  举报