Answer the question
In order to leave comments, you need to log in
Why does mssql throw an error?
sqlfiddle.com/#!6/14e507/16
Wording:
"We need to remove unnecessary entries and leave only the first clients"
The passport number must be unique.
Error: An expression of non-boolean type specified in a context where a condition is expected, near ')'.
Actually, I tried it in SQLLite, and everything worked fine:
sqlfiddle.com/#!7/68e68/2
Answer the question
In order to leave comments, you need to log in
DELETE e
FROM #employees e
INNER JOIN (
SELECT id
,RANK() OVER (PARTITION BY pass_num ORDER BY ID) RNK
FROM #employees
) X ON X.id = e.id
WHERE x.RNK > 1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question