About 8,120,000 results
Open links in new tab
  1. 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.

  2. Case expression for Order By clause with Desc/Asc sort

    Case expression for Order By clause with Desc/Asc sort Asked 11 years, 3 months ago Modified 1 year ago Viewed 46k times

  3. sql - TSQL - Is it possible to define the sort order? - Stack Overflow

    Jun 2, 2017 · Is it possible to define a sort order for the returned results? I would like the sort order to be 'orange' 'apple' 'strawberry' not ascending or descending. I know ORDER BY can do …

  4. SQL ORDER BY date problem - Stack Overflow

    Oct 10, 2009 · This won't sort correctly if the current language and date format settings cause interpret aa/bb/cccc as month/day/year, as is the case for most US installations of SQL Server.

  5. How to use order by with union all in sql? - Stack Overflow

    Mar 18, 2013 · SELECT * FROM (SELECT * FROM TABLE_A ORDER BY COLUMN_1)DUMMY_TABLE UNION ALL SELECT * FROM TABLE_B It results in the following …

  6. sql - CASE WHEN statement for ORDER BY clause - Stack Overflow

    I am using SQL Server 2008 R2. I want the priority based sorting for records in a table. So that I am using CASE WHEN statement in ORDER BY clause. The ORDER BY clause is as below : …

  7. sqlite - How to use SQL Order By statement to sort results case ...

    Mar 10, 2010 · I have a SQLite database that I am trying to sort by Alphabetical order. The problem is, SQLite doesn't seem to consider A=a during sorting, thus I get results like this: A B C …

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

    I have a SQL table with a datetime field that can be null. What is a simple way to sort query results ascending by datetime, but with rows where datetime is null at the end, not at the beginning?

  9. sql - mysql group by and sort each group - Stack Overflow

    SELECT * FROM `table` GROUP BY `NAME` ID NAME TIME 1 A 0 3 B 1 And I want use GROUP BY to generate a result like this (discount sort by the TIME column): ID NAME TIME 2 A 3 3 B 1 …

  10. sql - How to sort values in columns and update table? - Stack …

    SELECT * FROM games ORDER BY name ASC But how can I sort the values of id column and save changes in table? Please, help.