Hey guys, working on a simple query here, but I'm not getting the results I expect. Here is the exact question I am to work:
Quote:
|
Find the book code and book title for each book whose price is more than $10 or that was published in Boston.
|
Here is what I came up with:
Code:
SELECT B.BookCode, B.Title
FROM Book B
WHERE B.Price > '10'
UNION
SELECT B.BookCode, B.Title
FROM Book B, Publisher P
WHERE B.PublisherCode = P.PublisherCode;
However, this returns all the Books, even though I shouldn't. What did I do wrong? The chapter I am studying is specifically going over the SET operators (UNION, INTERSECT & MINUS), and the ANY and ALL operators. I figured UNION was closest to the example in the book, so thats why I choose that.