The SELECT clause defines the list of attributes on the records produced by the statement.
SELECT <expression> AS <attributeKey>[, <expression> AS <key>]*
SELECT Sum(Amount) AS TotalSales
SELECT Sum(Amount) AS TotalSales, TotalSales / 4 AS QuarterAvg
DEFINE ResellerInfo as SELECT DimReseller_ResellerName, DimGeography_StateProvinceName, DimReseller_Phone; RETURN Resellers as SELECT * FROM ResellerInfo
The query first generates an intermediate result (named ResellerInfo) from data in three attributes, and then uses SELECT * to select all the attributes from ResellerInfo.
DEFINE Reseller AS SELECT DimReseller_ResellerKey, DimReseller_ResellerName, DimReseller_AnnualSales; DEFINE Orders AS SELECT FactSales_ResellerKey, FactSales_SalesAmount; RETURN TopResellers AS SELECT R.*, O.FactSales_SalesAmount FROM Reseller R JOIN Orders O on (R.DimReseller_ResellerKey = O.FactSales_ResellerKey) WHERE O.FactSales_SalesAmount > 10000
In the example, the expression R.* (in the RETURN TopResellers statement) expands to include all the attributes selected in the DEFINE Reseller statement.
SELECT Amt AS Z, * or SELECT *, Amt AS Zif * includes an attribute named Z, then whichever attribute comes first is the one included in the result.
SELECT * FROM a JOIN b ON (...)
If a and b both contain an attribute with the same name, then you get the attribute from the first statement in the JOIN clause.