Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculated fields in SQL
Message
De
13/02/2006 17:26:15
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01095969
Message ID:
01096000
Vues:
15
But I am not referencing X2 and Y2, I am referencing nodes.x and nodes.y.
If they are calculated fields, you are right, but they are not (if the example SELECT is correct).

>It's not going to work. You cannot reference calculated fields in consequent calculations in the same list. You can use derived table
>SELECT *, ABS(dt1.x2-dt2.y2) AS dx ;
>  FROM ( ;
>select temp1.*,nodes.x as x2, nodes.y as y2,
>	from UPDNETATR!xydata nodes ;
>	right outer join temp1 ;
>	on  nodes.n = temp1.b;
>	where st_name <> ' ' ;
>	order by temp1.st_name ;
>       ) dt1
>
>>Yes it is:
>>BTW the result contains x2 and Y2 :-)
>>of course if you didn't have X1 in Temp1
>>
>>select temp1.*,nodes.x as x2, nodes.y as y2, ABS(nodes.x-nodes.y) AS dx;
>>	from UPDNETATR!xydata nodes ;
>>	right outer join temp1 ;
>>	on  nodes.n = temp1.b;
>>	where st_name <> ' ' ;
>>	order by temp1.st_name
>>
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform