Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

quick question 2

Status
Not open for further replies.

hokky

Technical User
Nov 9, 2006
170
AU
Hi guys,

Just quick question
see the code below (which doesn't work)
Code:
SELECT * FROM CURVEDEFINITION
where CURVE LIKE ('AUDUSD%DELTA%' OR 'AUDCAD%DELTA%')

As you see, I want to select ALL CURVE LIKE 'AUDUSD%DELTA%' AND 'AUDCAD%DELTA%'

Can you guys tell me how am I suppose to do this in microsoft sql?

Thanks guys,
 
where ( CURVE LIKE 'AUDUSD%DELTA%'
OR CURVE LIKE 'AUDCAD%DELTA%')
 
Code:
SELECT *
       FROM CURVEDEFINITION
where (CURVE LIKE 'AUDUSD%DELTA%' OR
       CURVE LIKE 'AUDCAD%DELTA%')
But I am not sure what you want your query uses OR but you want AND?

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
Microsoft MVP VFP
 
>But I am not sure what you want your query uses OR but you want AND?

Typical user confusion, Boris, over AND and OR. It must be OR because the conditions are mutually exclusive: AND would never return anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top