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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Values in Like Statement 1

Status
Not open for further replies.

nickotine

Programmer
Nov 27, 2001
23
GB
Help Please.
I am trying to insert Multiple values in a LIKE statement, I.e.

select object, bin
from ourhouse t
where t.rowid = :rowid
and bin = '*'
and store like ('EL%','TA%')

I keep getting a message saying Missing Right Parenthesis.

Thanks in advance.
 
You may compare only against single format mask. Use OR instead.

Code:
select  object, bin
from ourhouse t 
where t.rowid = :rowid
and bin  = '*'
and (store like 'EL%' or store like 'TA%')

This is a common rule, but your specific case may be rewritten as:

Code:
select  object, bin
from ourhouse t 
where t.rowid = :rowid
and bin  = '*'
and substr(store,1,2) in ('EL','TA')


Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top