You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Current »

ORDER BY can use any amount of fields/ columns. Columns should be contained as expressions within the SELECT clause.
Table names, Column Names and Aliases are case insensitive and may contain an alphabetic character followed by alphanumeric -unless you put square brackets around the token, and then any character can be used. Names and aliases with a space also need to contained within square brackets.
Example:
SELECT OrderID, productid AS [1pID], suppID +' '+empID AS SuppEmpFROM [ORDER DETAILS] AS detailsORDER BY productid, suppID +' '+empID

  • No labels