Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why did they do this
Message
De
27/03/2005 10:25:10
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00999274
Message ID:
00999330
Vues:
13
Thanks,

It was late on Friday and I was being pressured to get it running. She is alot better programmer than I am and I thought she was referencing two different tables, she usually uses one letter for aliasing , anyway I got into that thought process loop and could not get out.

Thanks everyone you have been a great help.
Jim

>Jim,
>
>The full form of 'wms_ITRN_all wms_ITRN' is 'wms_ITRN_all AS wms_ITRN', where 'AS' is optional. It assigns alias 'wms_ITRN' to table 'wms_ITRN_all'. After that you have to reference the table in the query by he assigned alias. There're a coule reasons for using aliases:
>1. Convinience. A short alias can make a query easier to read
>1. To use the same table more than once in the query in self-join or subquery
>
>In your case it looks like reason # 1 but I'm not sure what is gained. I would use 2-3 letter aliases and for consistency alias all tables in the query.
>
>FROM wms_ITRN_all itrn
>	INNER JOIN Inventory inv
>	ON itrn.Sku = inv.primary_reference
>	LEFT OUTER JOIN wms_AdjustmentDetail_All ad
>		ON itrn.ItrnKey = ad.ItrnKey
>
>
>>I am redoing one of the programs from one of our best programmers who left.
>>Why did she code FROM wms_ITRN_all wms_ITRN without a comma and then join them later ?
>>
>>
>
>>FROM
>>	
>>		wms_ITRN_all wms_ITRN
>>	INNER JOIN
>>		Inventory
>>	ON
>>		wms_ITRN.Sku = Inventory.primary_reference
>>	LEFT OUTER JOIN
>>	    wms_AdjustmentDetail_All
>>		ON wms_ITRN.ItrnKey = wms_AdjustmentDetail_All.ItrnKey
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform