随笔分类 -  MySQL

摘要:创建: create [unique] index indexname on tablename(col); alter table tal_name add primary_key(cloumn_list);该语句添加一个主键,这说明索引值必须唯一,且不能为null alter table tal 阅读全文
posted @ 2020-09-06 16:56 年少而为 阅读(114) 评论(0) 推荐(0)
摘要:1.distinct去重 去掉所有相同字段 2.group_concat函数 select id,group_concat(price separator ';') from goods group by id; 3.聚合函数加count 在select中使用count(distinct 字段) 阅读全文
posted @ 2020-08-10 16:30 年少而为 阅读(319) 评论(0) 推荐(0)