Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Incorrect syntax near INNER. Expecting ID

SELECT Outer.JobId FROM JobHistory  Outer
INNER JOIN
(
    SELECT TOP 10 JobId AS JobId, MAX(UpdateDate) AS UpdatedDate
    FROM JobHistory 
    GROUP BY JobId
) Sub
ON Outer.JobId = Sub.JobId

>Solution :

Outer is a keyword in sql server, so avoid using this as alias

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

SELECT JH.JobId FROM JobHistory JH
INNER JOIN
(
    SELECT TOP 10 JobId AS JobId, MAX(UpdateDate) AS UpdatedDate
    FROM JobHistory 
    GROUP BY JobId
) Sub
ON JH.JobId = Sub.JobId
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading