Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: User variables, if function
10-23-2013, 11:28 PM #1
- Join Date
- Dec 2005
- Thanked 76 Times in 76 Posts
User variables, if functionCode:
select if (@num1=1,@num1 := @num1 + 1,@num1 := @num1 +2 ) c from tbl ...
select if (@num1 =1,@num1 := @num1 + 1,@num1 := @num1 +2;@a = 't' ) c from tbl ...
10-24-2013, 06:47 PM #2
Must use two separate IF's.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.