Help for Ordering the rows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DDE
    New Member
    • May 2007
    • 3

    Help for Ordering the rows

    Hello,

    I have a table as follows:
    Branch_ID Branch_Name
    8861 Puebla
    8862 Vosges
    8863 Maryland
    8864 Delaware
    8865 Veracruz-Llave
    8866 Jarvis Island
    8867 Montana
    8868 Kentucky
    8869 Brussels
    8870 Morelos
    8871 Eure-et-Loir
    8872 Baja California
    8873 Louisiana
    8874 Johnston Atoll
    8875 Yucatan
    8876 Sinaloa

    I want to get the BranchID from the table using IN query.. I am using the following query for that
    SELECT Branch_Id, Branch_Name
    FROM Branch_List
    WHERE (Branch_Name IN ('Puebla', 'Maryland', 'Jarvis Island', 'Kentucky', 'Louisiana', 'Eure - et - Loir', 'Baja California', 'Brussels')). I want the query to return the rows in the same order as the Branch names given in the IN condition of the query. How can i do it..Everytime it is returning the rows in different order..Please help me with this query.
Working...