R
Raymond Martin
I created an Access query, and when SQL reformatted it, it added a special
alias as shown below. I cannot seem to find any info on this behavior, and
although the query works fine, if I change the name of the alias it will
not work. What's happening?
SELECT product, (avg_unit_cost * (qty_on_hand - deliverable)) AS inv_value
FROM [SELECT [inventorymaster].[product], [avg_unit_cost], [qty_on_hand],
sum([qty_sold]-[total_qty_delivered]) AS deliverable
FROM inventorymaster LEFT JOIN invoice_line ON
[inventorymaster].[product]=[invoice_line].[product]
GROUP BY [inventorymaster].[product], [avg_unit_cost], [qty_on_hand]]. AS
[%$##@_Alias];
alias as shown below. I cannot seem to find any info on this behavior, and
although the query works fine, if I change the name of the alias it will
not work. What's happening?
SELECT product, (avg_unit_cost * (qty_on_hand - deliverable)) AS inv_value
FROM [SELECT [inventorymaster].[product], [avg_unit_cost], [qty_on_hand],
sum([qty_sold]-[total_qty_delivered]) AS deliverable
FROM inventorymaster LEFT JOIN invoice_line ON
[inventorymaster].[product]=[invoice_line].[product]
GROUP BY [inventorymaster].[product], [avg_unit_cost], [qty_on_hand]]. AS
[%$##@_Alias];