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 |
|
tehprince
Starting Member
9 Posts |
Posted - 2008-11-14 : 12:04:45
|
| I'm looking to do the following in my SP:IF @param1 = 1 select blah from blah where blah = blah if @param2 = 2 group by different else do something elseELSE blah |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-14 : 12:09:45
|
| you cant group conditionally like this. you need to use CASE..WHEN..ELSE in GROUP BY for this. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-15 : 01:48:57
|
| or you can very well use IF THEN logic tooMadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-15 : 04:46:49
|
quote: Originally posted by madhivanan or you can very well use IF THEN logic tooMadhivananFailing to plan is Planning to fail
But not like what OP posted anyways Each branch should contain a whole SELECT query. |
 |
|
|
|
|
|