开发者

Why distinct produces syntax error when mixed with other none distinct rows?

开发者 https://www.devze.com 2023-02-05 21:08 出处:网络
All these attempts fail: SELECT DISTIN开发者_开发知识库CT(row1,row2), * FROM foo SELECT *, DISTINCT (row1,row2) FROM foo

All these attempts fail:

SELECT DISTIN开发者_开发知识库CT(row1,row2), * FROM foo

SELECT *, DISTINCT (row1,row2) FROM foo

SELECT *, DISTINCT row1,row2 FROM foo

I want to fetch all rows but not duplicate rows on row1 & row2

PS. I don't want to use GROUP By.

Thanks!


You can only use DISTINCT on the entire row, not part of it.

PS. I don't want to use GROUP By.

That's a shame, because GROUP BY would have been the correct way to do this.

0

精彩评论

暂无评论...
验证码 换一张
取 消