摘要: 1、汇总表中的某一列中不同的列值的个数 select 列名,count(列名) from 表名 group by 列名 2、当需要对分组进行过滤时,使用having 比如要过滤 count(列名)>=2 select 列名,count(列名) from 表名 group by 列名 having c 阅读全文
posted @ 2020-04-19 16:20 kittyy 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 1、比较datetime类型的日期,例如数据库中的存储类型是datetime,查询日期为"2020-4-19"的值就用 select * from table where date(time)=“2020-4-19 2、查询表中不同列的计数 select count(distinct 列名)from 阅读全文
posted @ 2020-04-19 15:28 kittyy 阅读(304) 评论(0) 推荐(0) 编辑