Problem with Union Help!!!!

Giganews Newsgroups
Subject: Problem with Union Help!!!!
Posted by:  Mos (lndeb…@gmail.com)
Date: Mon, 6 Dec 2010

Folks I am having a problem with two queries

Incorrect syntax near the keyword 'UNION'.

SELECT p.TemplateId, c.TemplateName
FROM DOCUMENTS_TEMPLATES p INNER JOIN DOCUMENTS_TEMPLATES c
ON p.TemplateId = c.TemplateParent
WHERE p.TemplateId = 200
ORDER BY p.TemplateId
UNION
SELECT p.TemplateId, c.TemplateName
FROM DOCUMENTS_TEMPLATES p INNER JOIN DOCUMENTS_TEMPLATES c
ON p.TemplateId = c.TemplateParent
WHERE p.TemplateId = 398
ORDER BY p.TemplateId

SQL 2008 R2

Replies