Reply
SQL WHERE with LIKE clause
Old 08-14-2007, 02:06 PM SQL WHERE with LIKE clause
Novice Talker

Posts: 9
I have a SQL select statement, but I don't know how to finish it. The part in red works fine, but it's the part in blue I don't know how to do. BAsically I need to use the LIKE clause but also ignore a specific record which the LIKE clause finds.

SELECT product WHERE partno LIKE "111%" NOT 1114

Any suggestions on how to do this?

jfdt is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 08-14-2007, 02:22 PM Re: SQL WHERE with LIKE clause
tripy's Avatar
Fetchez la vache!

Posts: 2,055
Name: Thierry
Location: In the void
Code:
SELECT product
WHERE partno LIKE '111%'
AND partno != '1114'
String character generally must be surrounded by single quotes, not double.
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Old 08-14-2007, 02:27 PM Re: SQL WHERE with LIKE clause
Novice Talker

Posts: 9
Thanks, that seemed to do the trick. I was using single quotes also, I used double quotes in the example by mistake (wasn't a copy/paste).
jfdt is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to SQL WHERE with LIKE clause
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.96667 seconds with 12 queries