|
Email lists >
aspnet at aspadvice.com >
[aspnet] RE: SQL GURU: IN operator with Case Statement >
[aspnet] RE: SQL GURU: IN operator with Case Statement
[aspnet] RE: SQL GURU: IN operator with Case Statement
This post if a part of this thread
|
2008-06-10 11:40:46 |
|
|
RE: SQL GURU: IN operator with Case Statement
|
|
|
problem with this is, if the user submits a parm, then it has to be used in the where clause.
I added a value of "0" with text "-All-" in the page drop down in the first index before the 3 hard-coded codes. So, that's why I'm checking for parm = 0.
Date: Tue, 10 Jun 2008 11:56:38 -0400 From: terri.morton gmail.com To: aspnet aspadvice.com Subject: [aspnet] RE: SQL GURU: IN operator with Case Statement
But you could do a LEFT OUTER JOIN:
declare tbl TABLE( intCodes INT) INSERT tbl select 123INSERT tbl select 456INSERT tbl select 789 SELECT blah, blahFROM tblBlahLEFT OUTER JOIN tbl ON tblBlah.intField = tbl.intCodesWHERE tbl.intcodes IS NOT NULL OR param = 0 FWIW, I always recommend these great articles by Erland Sommarskog on Arrays and Lists in SQL Server: http://www.sommarskog.se/arrays-in-sql-2005.html http://www.sommarskog.se/arrays-in-sql-2000.html
On Tue, Jun 10, 2008 at 11:45 AM, Tim Curtin < tjc_tek  hotmail.co m">tjc_tek hotmail.com> wrote:
--- List Settings --- http://aspadvice.com/lists/
Enjoy 5 GB of free, password-protected online storage. Get Windows Live SkyDrive.
--- List Settings ---
http://aspadvice.com/lists/
|
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|