Sort the table RRS feed

  • Question

  • User306244618 posted

    Hi Friends,

     Can you please tell me how do i sort my table according to the particular field.

    Let's say i have one table ( Car ) with fields ( Name, Price,Model)

    i want to sort my table based on the model .

    For example all Model B will come first,

             then    all Model A,

           then all the rest model.

    Please help me

     Thanks in Advance.


    Monday, June 1, 2009 12:12 AM


  • User541108374 posted


    you can create a new column that holds a sequence number (just an int value where you determine the ordering/sorting on) and use the orderby clause on that column. If you don't know how to use the order by statement take a look here: http://www.w3schools.com/sql/sql_orderby.asp.

    Grz, Kris.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 1, 2009 4:55 AM