热线电话:13121318867

登录
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只能放到字段名之前不能出现在某个字段之后。

44.9969
2
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子