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

ReWrite Query 1

Status
Not open for further replies.

coldfused

Technical User
Jan 27, 2001
2,442
US
Code:
<cfquery name="getprograms" datasource="#dsn#">
Select * From programs Where w_specs LIKE '%#TheCenter#%'
OR wb_specs LIKE '%#TheCenter#%' 
OR s_specs LIKE '%#TheCenter#%'
OR sb_specs LIKE '%#TheCenter#%'
OR sum_specs LIKE '%#TheCenter#%'
OR sumb_specs LIKE '%#TheCenter#%'
OR f_specs LIKE '%#TheCenter#%'
OR fb_specs LIKE '%#TheCenter#%'

</cfquery>

Is there a cleaner way to write that query and eliminate all of the OR's?

Thanks.

----------------------------------------
Online Marketing - de·ci·phered
Always Learning...
 
not really all that much cleaner...
Code:
 WHERE  w_specs 
||'~'|| wb_specs 
||'~'|| s_specs 
||'~'|| sb_specs 
||'~'|| sum_specs 
||'~'|| sumb_specs 
||'~'|| f_specs 
||'~'|| fb_specs LIKE '%#TheCenter#%'

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top