List:General Discussion« Previous MessageNext Message »
From:Martin Gainty Date:October 4 2012 2:06pm
Subject:RE: (real) silly question about variables...
View as plain text  

in a mySQL statement the values are displayed BEFORE assignments are made

Ciao,
No MAS
______________________________________________ 

				
					
					
					Per favore non alterare o perturbare la comunicazione


> From: urkapd@stripped
> Subject: (real) silly question about variables...
> Date: Thu, 4 Oct 2012 15:52:20 +0200
> To: mysql@stripped
> 
> Hi
> 
> I know there'd be a reason, but I can't understand that..
> 
> mysql> select @valore:=rand(), @valore, @valore:="ciao", @valore;
> +-------------------+-------------------+-----------------+---------+
> | @valore:=rand()   | @valore           | @valore:="ciao" | @valore |
> +-------------------+-------------------+-----------------+---------+
> | 0.483624490428366 | 0.483624490428366 | ciao            |       0 |
> +-------------------+-------------------+-----------------+---------+
> 1 row in set (0.00 sec)
> 
> mysql> select @valore:=rand(), @valore, @valore:="ciao", @valore;
> +-------------------+-------------------+-----------------+---------+
> | @valore:=rand()   | @valore           | @valore:="ciao" | @valore |
> +-------------------+-------------------+-----------------+---------+
> | 0.747058809499311 | 0.747058809499311 | ciao            | ciao    |
> +-------------------+-------------------+-----------------+---------+
> 1 row in set (0.00 sec)
> 
> why in the first execution the latest value is 0 and not 'ciao'?
> and why in the first 2 columns the variables seems works as expected!?
> 
> thank you in advance
> 
> bye
> MAS!
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql
> 
 		 	   		  
Thread
(real) silly question about variables...MAS!4 Oct
  • Re: (real) silly question about variables...Derek Downey4 Oct
  • Re: (real) silly question about variables...rich gray4 Oct
    • Re: (real) silly question about variables...MAS!4 Oct
      • Re: (real) silly question about variables...hsv6 Oct
  • RE: (real) silly question about variables...Martin Gainty4 Oct