I misspoke. I meant that you cannot use an alias that refers to an aggregate function value (like count, max, min, etc.) in the order by clause. If you merely provide an alias on a database field (i.e.: myfield AS mynewfield), you can use that in the order by clause.

Carl

On 12/16/2010 4:09 PM, Adam Cameron wrote:
If QofQ follows the same rules as SQL Server, you cannot reference an
alias in the order by clause.  Try changing the last line to:
Really?  That kinda conflicts with the docs:

SQL Server 2000:
http://msdn.microsoft.com/en-us/library/aa259187%28v=sql.80%29.aspx#_order_by_clause

2008:
http://msdn.microsoft.com/en-us/library/ms188385.aspx

Unfortunately I don't have a working SQL Server instance to verify
this, but I'm definitely used aliases in ORDER BY statements in the
past.

--
Adam


--
Open BlueDragon Public Mailing List
http://www.openbluedragon.org/   http://twitter.com/OpenBlueDragon
official manual: http://www.openbluedragon.org/manual/
Ready2Run CFML http://www.openbluedragon.org/openbdjam/

mailing list - http://groups.google.com/group/openbd?hl=en

Reply via email to