Quantcast
Channel: Answers for "Trying to UNION 2 SELECTs from same tables"
Viewing all articles
Browse latest Browse all 4

Answer by JohnM

$
0
0
Why can't you just put it all in one statement? Like this: SELECT ca.Name AS AgeGroup, ca.Category FROM Category AS ca INNER JOIN Category AS parentca ON ca.ParentCategoryID = parentca.CategoryID INNER JOIN ProductCategory AS prodca ON ca.CategoryID = prodca.CategoryID WHERE (parentca.Name = N'Books By Age' or parentca.Name=N'Kids Books') AND (prodca.ProductID = 30891) Or am I missing something else? Hope this helps!

Viewing all articles
Browse latest Browse all 4

Trending Articles