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.

Multiple columns in OVER ORDER BY

Is there a way to specify multiple columns in the OVER ORDER BY clause? SELECT ROW_NUMBER() OVER(ORDER BY (…

sql sql-server sql-order-by row-number
Why does MySQL Innodb "Creating sort index" when unique index exists?

On a simple but very large Innodb table, I have a unique index on column A and I want to …

mysql sql-order-by innodb filesort
Mysql: Order by like?

assume that we are performing search using keywords: keyword1, keyword2, keyword3 there are records in database with column "name": 1: John …

mysql sql sql-order-by sql-like
TSQL ORDER BY with nulls first or last (at bottom or top)

I have a date column which has some NULL. I want to order by the date column ASC, but I …

sql-server tsql sql-order-by isnull
Mongo order by length of array

Lets say I have mongo documents like this: Question 1 { answers:[ {content: 'answer1'}, {content: '2nd answer'} ] } Question 2 { answers:[ {content: …

mongodb size sql-order-by
SQLite ORDER BY string containing number starting with 0

as the title states: I have a select query, which I'm trying to "order by" a field which contains numbers, …

sql string sqlite sql-order-by numeric
Postgres: left join with order by and limit 1

I have the situation: Table1 has a list of companies. Table2 has a list of addresses. Table3 is a N …

postgresql sql-order-by left-join foreign-key-relationship duplicate-removal
Order by clause with Union in Sql Server

I want List of party names with 1st option as 'All' from database. but i won't insert 'All' to Database, …

sql sql-server sql-order-by union
Using distinct on a column and doing order by on another column gives an error

I have a table: abc_test with columns n_num, k_str. This query doesnt work: select distinct(n_num) …

sql oracle sql-order-by distinct oracle9i
TSQL - Is it possible to define the sort order?

Is it possible to define a sort order for the returned results? I would like the sort order to be …

sql sql-server tsql sql-server-2000 sql-order-by