Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Using the LIKE and AND

Author  Topic 

Margo
Starting Member

2 Posts

Posted - 2008-03-04 : 21:57:57
Hi all, I am a total "NEWB" to SQL and this is my first post here. I can tolerate snickers to get the help I need

I have to use the WHERE clause to include "LIKE" a name that includes particular letters but also the "AND" to have a a price of <100.

It looks so easy in the tutorial but I cannot go on because my results just list the column headings but nothing else.

Thank you for helping.

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2008-03-04 : 22:12:51
Select columname
FROM tablename
Where namecolumn like '%letters%' AND pricecolumn < 100


Why do you need to use Like? is the name of the item not unique enough?




Poor planning on your part does not constitute an emergency on my part.

Go to Top of Page

Margo
Starting Member

2 Posts

Posted - 2008-03-05 : 00:24:06
Thank you dataguru! I did the same thing except I did not use % in the front and end of the search. I will try that. I guess I have to use "like" so it includes a name that has "the words" somewhere in the name.
I am very appreciative of your prompt response and will try that definitely!
Go to Top of Page
   

- Advertisement -