About 290,000 results
Open links in new tab
  1. SQLAlchemy ORDER BY DESCENDING? - Stack Overflow

    How can I use ORDER BY descending in a SQLAlchemy query like the following? This query works, but returns them in ascending order: query = (model.Session.query(model.Entry) …

  2. sorting - SQL multiple column ordering - Stack Overflow

    Jan 12, 2010 · How can I sort multiple columns in SQL and in different directions? For instance, 'column1' would be sorted descendingly and 'column2' ascendingly.

  3. sql - How to order by column A and then by column B ... - Stack …

    Jan 15, 2022 · Each sort expression may be optionally followed by a COLLATE keyword and the name of a collating function used for ordering text and/or keywords ASC or DESC to specify …

  4. sql - Order by descending date - month, day and year - Stack …

    SELECT * FROM vw_view ORDER BY EventDate DESC It gives me the date ordered by month and day, but doesn't take year into consideration. for example:

  5. Sorting in descending order in SQL - Stack Overflow

    Mar 6, 2018 · I want to sort the table in descending order on the basis of id 1. SELECT * FROM table_name ORDER BY id1 DESC works fine but same id1 should be sorted in descending …

  6. Sorting by date & time in descending order? - Stack Overflow

    Mar 1, 2012 · A simple ORDER BY DATE(updated_at) DESC, name DESC would have the same result. Not to mention that the syntax you have is not valid SQL (despite that MySQL may …

  7. sql - Make nulls come last when sorting ascending - Stack Overflow

    AFAIK NULLS FIRST and NULLS LAST have been added in SQL:2003 but there is no standard implementation available throughout the different DMBS'. Depending on the database engine, …

  8. sql - How to use DISTINCT and ORDER BY in same SELECT …

    ORDER BY CreationDate DESC SELECT Category i.e. remove the extended sort key column again from the result. So, thanks to the SQL standard extended sort key column feature, it is …

  9. sql - Order results by COUNT without GROUP BY - Stack Overflow

    FROM table GROUP BY Group ORDER BY COUNT(*) DESC The DESC keyword allows you to show the highest count first, ORDER BY by default orders in ascending order which would …

  10. SQL ORDER BY date problem - Stack Overflow

    Oct 10, 2009 · Can you please help me in solving this problem. I am trying to order the results of an SQL query by date, but I'm not getting the results I need. The query I'm using is: SELECT …