-
<> when it applies to two or more columns
My question is how do I properly enter the information. I'm working on an exercise for class and I can get one item to be deleted from the list. I enter the following information:
select,customerid,item from item_ordered where item <> 'Tent';
I want to make the string remove the catagory, 'Umbrella' along with the catagory named 'tent'. I have learned how to remove one item from a column, but how do you apply this technique to two or more items as well.
I have tried a variety of different configurations using the <> path and have not tried any others. Am I logically thinking this through?
-Ron
-
Add another condition. You can add an AND or an OR, depending on what it is you want to filter out. One way then would be to use where item <> 'Tent' or item <> 'Umbrella.'
Yet another (more efficient way) is to use a list. The query would be:
select customerid, item
from item_ordered
where item not in ('Tent', 'Umbrella');
-
Try this if you are using sql server:
select customerid, item from item_ordered
where item not in ('Tent', 'Umbrella')
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|