Sorting

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.
 
B

Bob Barrows

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".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top