开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜