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-24-2013, 12:28 AM #1
- Join Date
- Dec 2005
- Thanked 77 Times in 77 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, 07: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.