Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2010
    Posts
    44

    Unanswered: Order by Clause using a UNION and a Function

    Is it possible to do an order by clause on a 4 unions with 2 of them using a Max() function? If so, what could possibly be the way it would work?

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Untested, but I suspect so. The ORDER BY clause would have to be part of the last query, but use the field names from the first SELECT statement. Those requirements are not unique to the fact that you use the Max() function; they are requirements for any UNION query.
    Paul

  3. #3
    Join Date
    Sep 2006
    Posts
    265
    I would create your Union query (without the Order By) and then another Query (with the Order By) based on the Union Query

    Simon

  4. #4
    Join Date
    Jan 2010
    Posts
    44
    Thanks a lot. That worked. Now I am going to post a new Issue.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •