2020-03-03
阅读量:
1172
distinct 报语法错误1064
distinct 报语法错误1064,代码及报错如下:

答:这是distinct的用法不熟练所致,distinct只能在select 之后出现,他可以作用于一个字段之上,也可以作用于多个字段之上
select distinct 字段1 from some_table;
作用于多个字段,如果distinct后方多个字段,去重去的就是3个字段“同时相同”的记录
select distinct 字段1,字段2,字段3 from some_table;
总之 distinct只能放到字段名之前不能出现在某个字段之后。






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论