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.
精彩评论