MySQL Forums
Forum List  »  Quality Assurance

Question about [ @NAME := ..... ]
Posted by: Ellie Kim
Date: June 04, 2008 03:03AM

I was trying to make my query short, and found a good function- even I still dont know the name of the function, -
and \i wrote my query like below.

-----------------------------------------
SELECT
 @B-@A,
 @A := COL_A,
 @B := COL_B,
 @A-@B
FROM TABLE
-----------------------------------------
it worked, but i found two errors on it.

first, the first column (@B-@A) appears at another line.
like this.
-----------------------------------------
a5-b5    a1    b1      a1-b1       
a1-b1    a2    b2      a2-b2       
a2-b2    a3    b3      a3-b3       
a3-b3    a4    b4      a4-b4       
a4-b4    a5    b5      a5-b5 
----------------------------------------      
                                
second,
I've never seen this function [ @NAME := ..... ] before,
so I dont know where to reference.



Is there anyone could teach me about this lovely source? T_T

OR is there any good wat to reference AliasNAme?



+Thanx for reading. =)



Edited 6 time(s). Last edit at 06/06/2008 02:29AM by Ellie Kim.

Options: ReplyQuote


Subject
Views
Written By
Posted
Question about [ @NAME := ..... ]
2798
June 04, 2008 03:03AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.