Top "Sql-order-by" questions

An ORDER BY clause in SQL specifies that a SQL SELECT statement returns a result set with the rows being sorted by the values of one or more columns.

Dynamic order direction

I writing a SP that accepts as parameters column to sort and direction. I don't want to use dynamic SQL. …

sql sql-server stored-procedures sql-order-by case
What is the default order of a list returned from a Django filter call?

Short Question What is the default order of a list returned from a Django filter call when connected to a …

python django postgresql sql-order-by django-orm
Sort MySQL results alphabetically, but with numbers last

Often, sorting is done with symbols sorted to the top, like 0 or * or &. This is the default way that …

mysql sql-order-by alphabetical-sort
How to do case-insensitive order in Rails with postgresql

I am in the process of switching my development environment from sqlite3 to postgresql 8.4 and have one last hurdle. In …

ruby-on-rails ruby postgresql sql-order-by case-insensitive
How can I sort by a table column in varying cases (Oracle)

How can I sort a table with a column of varchar2 with characters in varying cases (UPPER and lower)? For …

sql oracle select sql-order-by case-sensitive
SQL Server: ORDER BY in subquery with UNION

i have two queries being combined with a UNION ALL1: --Query 1 SELECT Flavor, Color FROM Friends   --Query 2 SELECT Flavor, (SELECT …

sql-server sql-server-2000 sql-order-by union union-all
Order by day_of_week in MySQL

How can I order the mysql result by varchar column that contains day of week name? Note that MONDAY should …

mysql sql sql-order-by dayofweek
What does "ORDER BY (SELECT NULL)" mean?

The following SQL is from Itzik Ben-Gan that is used to generate a numbers table. What does the order by (…

sql-server select sql-order-by
Ordering in a MySQL GROUP_CONCAT with a function in it

I want to order the results in a GROUP_CONCAT function. The problem is, that the selection in the GROUP_…

sql mysql sql-order-by group-concat
Custom ORDER BY Explanation

I found this some time ago and have been using it since; however, looking at it today, I realized that …

postgresql sql-order-by