How to Reorder Columns using SQL

Comments

2 comments

  • Avatar
    Gary Arnell

    Very helpful, thanks! I originally came to this thread thinking it was going to talk about ORDER BY clauses. I've found that if I have a query like this:

    SELECT * FROM report ORDER BY 1 DESC, 2 DESC, 3 DESC, 4 DESC

    Grow only seems to honor the first clause, even though SQLite's documentation states that multiple columns are supported (http://www.sqlitetutorial.net/sqlite-order-by/). Am I doing it wrong?

  • Avatar
    Scott Bowen

    Hi Gary! That SQL should work with the multiple "order by" clauses. Depending on the data, when you order by several columns it might not make much difference by the time the third or fourth "order by" clause goes into effect. I noticed that you've been working with our support team and they will be able to help out the best if you're still seeing issues.

Please sign in to leave a comment.