Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
meenu_susi
Starting Member
1 Post |
Posted - 2010-12-08 : 12:13:45
|
| Hi guys I have created a form in PHP which has 3 listbox options,name, city and country, now if a employee selects a value in any one of the listbox and clicks search, then the related record should be pulled out from a table (all records are stored ina single table)for eg : if I select 2 options name and city the relates records should be filtered and displayedsame way when i select all the 3 options and then the relates records should be displayedAnd I am not having any submit button everything should happen on the click event....Since I am new to SQL Query can anyone help me to create the SQL QueryMay me you can send me soem sample Query |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-12-20 : 08:39:04
|
| This is the general logicwhere (col1=@param1 or @param1 is null) and (col2=@param1 or @param2 is null) and (col3=@param3 or @param1 is null)MadhivananFailing to plan is Planning to fail |
 |
|
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2010-12-20 : 13:09:39
|
| Except that this can cause you performance problems. Catch all queries are expensive when done that way.Gail wrote a good article:http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/Charlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|