Gossamer Forum
Home : General : Databases and SQL :

Sql Query, Help!

Quote Reply
Sql Query, Help!
hello guys, I am trying to write this query and it seems doesnt' work.

I have a Customer table. In this table, I have two customers name: Curie Pierre, and Curie Marie.

I wrote the query below to find the customers name with 'Curie' but it didnt' work. Please advise what I need to do. Thanks a lot guys.

SELECT CUSTOMER_NAME, CUSTOMER_ID
FROM CUSTOMER
WHERE CUSTOMER_NAME = 'CURIE';
Quote Reply
Re: [hdnguyen3] Sql Query, Help! In reply to
Using the = operator will find exact matches of strings you are searching for. You need to use the LIKE operator within the WHERE clause...

Quote:

SELECT CUSTOMER_NAME, CUSTOMER_ID
FROM CUSTOMER
WHERE CUSTOMER_NAME LIKE '%CURIE%';


You might want to pick up a SQL book, like SQL for Dummies, that I have used in the past, and it is helpful.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Sql Query, Help! In reply to
thanks for replying. I tried that and it says "no rows selected".
Quote Reply
Re: [hdnguyen3] Sql Query, Help! In reply to
This should work:

Code:
SELECT CUSTOMER_NAME, CUSTOMER_ID
FROM CUSTOMER
WHERE CUSTOMER_NAME LIKE 'Curie%';

Last edited by:

Paul: Mar 15, 2003, 2:15 AM
Quote Reply
Re: [Paul] Sql Query, Help! In reply to
Thanks, it works great.