Sorting

  • Thread starter Thread starter carl
  • Start date Start date
C

carl

I use this query...

SELECT Query1.underlying, Query1.OCC_Vol, AS BOX_Vol, (/
OCC_Vol) AS BOX, [A]/OCC_Vol AS AMEX, [P]/OCC_Vol AS ARCA, [Z]/OCC_Vol
AS BATS, [C]/OCC_Vol AS CBOE, [W]/OCC_Vol AS C2, /OCC_Vol AS ISE,
[Q]/OCC_Vol AS NOM, [X]/OCC_Vol AS PHLX
FROM Query1;

Can I add a sort (descending) on OCC_Vol ?

Thank you in advance.
 
carl said:
I use this query...

SELECT Query1.underlying, Query1.OCC_Vol, AS BOX_Vol, (/
OCC_Vol) AS BOX, [A]/OCC_Vol AS AMEX, [P]/OCC_Vol AS ARCA, [Z]/OCC_Vol
AS BATS, [C]/OCC_Vol AS CBOE, [W]/OCC_Vol AS C2, /OCC_Vol AS ISE,
[Q]/OCC_Vol AS NOM, [X]/OCC_Vol AS PHLX
FROM Query1;

Can I add a sort (descending) on OCC_Vol ?

Thank you in advance.


Why not? It appears that OCC_Vol is one of the columns returned from Query1,
so there should be nothing preventing you from adding

ORDER BY OCC_Vol DESC

to this sql statement. If your question is whether a column not returned in
the SELECT list can appear in the ORDER BY clause, the answer is a guarded
"yes". If you add DISTINCT to the statement, then the answer would be "no".
 
Back
Top