Closed. This question is not reproducible or was caused by typos . It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 15 hours ago.
Improve this question
SELECT
DISTINCT on (bcolor) bcolor,
fcolor
FROM
distinct_dem
ORDER BY
bcolor,
fcolor;
Help me to solve this issue
Incorrect syntax near the keyword 'on'.
I am working on SQL Server.
1条答案
按热度按时间eqqqjvef1#
The query I provided appears to be using the PostgreSQL syntax for the DISTINCT ON clause. In SQL Server, the equivalent functionality can be achieved using a different approach. Here's an alternative query that achieves a similar result in SQL Server: