If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Unique SQL issue using a wildcard in my where statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-24-05, 16:39
Buckles Buckles is offline
Registered User
 
Join Date: Feb 2005
Posts: 7
Question Unique SQL issue using a wildcard in my where statement

Does anyone know how I could possibly ise a wildcard in my SQL statement similar to:

select Person from Table where Users=*

Now I know you are probably saying well why not use either:
select Person from Table
or
select Person from Table where Person like "%%"

The reason is this:
My program is feeding off a HUGE amount of data. I am using about 12 dropdown menus which all are column names in a View. I have all drop downs dependant on each other and have stored procedures feeding in the varibles from the dropdown menus. So I am great if a user selects 1 item off the dropdown list but I also want to give them the option to view all. So that is my problem. I could build the SQL query on the fly and execute it within the script but that would take a great deal of work and tons more processing time.

So example: if the user selects a variable from menu 1 great all subsequent dropdowns populate but if they want to see all items pertaining to dropdown 2 then the where clause in the stored procedure never executes due to no variable (or a *) being fed in. My best bet is to find some sort of wildcard that i could utilize with the "where =" operator and not build on the fly statements. At this point I really don't think it exists but I thought I would ask the experts before totaly giving up and testing the processing time for a "build on the fly" scenaro.
Reply With Quote
  #2 (permalink)  
Old 02-24-05, 17:04
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
... where 1=1 and ...
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 02-24-05, 17:13
Buckles Buckles is offline
Registered User
 
Join Date: Feb 2005
Posts: 7
OMG...Thank you, Thank you, Thank you! That was so simple and perfect!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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