Hi,

    I'm using a few variables to do some calculations in the select list
of a query  but I don't like those columns ( the ones performing the
calc's ) to be shown in the result. for example:

Set @var1=0;
Set @var2=1;

Select  Col1,                   as 'C1'
        Col2                    as 'C2'
        @var1:[EMAIL PROTECTED]       as 'C3'
        @var2:[EMAIL PROTECTED]@var1
from test

I would like to only see columns C1 , C2 and C3
But I need @var2:[EMAIL PROTECTED]@var1 because it is incremented for the next row

Is there a way to hide @var2:[EMAIL PROTECTED]@var1 but still do the calculation
it implies?

The only solution I found is by using a temporary table this way 

Set @var1=0;
Set @var2=1;

Create temporary table tmp_test as 
Select  Col1,                   as 'C1'
        Col2                    as 'C2'
        @var1:[EMAIL PROTECTED]       as 'C3'
        @var2:[EMAIL PROTECTED]@var1
from test;

Select C1, C2 ,C3 from tmp_test


Is there another way ? 


Thanks a million
Mauricio




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to