How to sort the data from database? RRS feed

  • Question

  • User1840611328 posted


    I have a test table in my database with four column Like name,old,sex and id. How could I read the table from my database and sort it based on specific column? I'm learning how to use ADO to sort and display the data in my database. Thanks in advance.

    Wednesday, January 3, 2018 1:51 PM


  • User-460007017 posted

    Hi jimschan,

    It should have nothing to do with classic asp but the sql query string. You only need to use the query string to sort the data when you were reading the data from the database. Like

    sql="SELECT Name, Old FROM mytable ORDER BY Old"
    rs.Open sql, conn<sub></sub><sup></sup>

    Best Regards,

    Yuk Ding

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Thursday, January 4, 2018 2:35 AM