Results 1 to 2 of 2

Thread: union

  1. #1
    Join Date
    Apr 2004
    Posts
    11

    Post Unanswered: union

    i have a table with country names

    table name:country
    column name:country
    it is populated with:
    UK
    USA
    africa
    asia
    japan

    i want a query which gives the foll output
    USA
    UK
    africa
    asia
    japan


    (i.e) USA and UK must be on the top 2 rows
    while the rest of the countries should come below these 2 and sorted in the ascending order.

    if it is possible with any other query also it is ok
    Last edited by bhargavi; 07-12-04 at 06:16.

  2. #2
    Join Date
    Mar 2004
    Posts
    20
    Hi

    My simple way would be to add a field and then use it to sort the result. e.g.

    UK 01 UK
    USA 02 USA
    Africa 03 Africa

    Alternately have ONLY the numeric prefix in your table but show only from postion 4 in the string. I'm sure other variations exist.

    You could have a seperate table having only USA and UK outer joined to the main one and sort by the null or otherwise of the mini table

    Good luck

    Gerry

Posting Permissions

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