r/DatabaseHelp • u/Cloud_The_Stampede • Oct 02 '16
Help with SQL server 2014 Select clauses.
I have an assignment that has been driving me crazy, I have been researching online with helpful information but I believe is beyond my comprehension.
I have two tables one has information about items containing the price of the item, the second has information about the vendor with company name information.
The statement I am supposed to write is going to give me results with data that has greater than 1000$ in price and contain the name "new" in the vendor list.
So far I have:
select ItemID, ItemDescription, CompanyName
from ITEM, VENDOR
Where ItemPrice > 1000 Having like 'New';
I kept getting syntax errors and again have tried to research the problem with no luck please help!
View all comments
Show parent comment
1
u/_Royalty_ Oct 04 '16
Since it's a couple of days later, can you (or someone) post your preferred solution? It would be helpful for others trying to learn like myself.
I'll try to answer your question though. His subquery wouldn't be effective because he neglected to use a wildcard operator, right? He would need .... LIKE 'New%' instead. Or am I barking up the wrong tree?