How to sort the rows in SQL?

How to sort the rows in SQL?

How to sort the rows in SQL?

View Answers

November 19, 2010 at 4:17 PM

Hi,

Here is the answer,

The ORDER BY clause allows you to sort the records in your result set. The ORDER BY clause can only be used in SELECT statements.

The syntax for the ORDER BY clause is:

SELECT column_list
FROM tablename
WHERE expression
ORDER BY column ASC / DESC;

The ORDER BY clause sorts the result set based on the columns specified. If the ASC or DESC value is omitted, it is sorted by ASC.

ASC indicates ascending order. (default)

DESC indicates descending order.

Thanks,









Related Tutorials/Questions & Answers:
How to sort the rows in SQL?
ModuleNotFoundError: No module named 'sqlt'
Advertisements
ModuleNotFoundError: No module named 'sqlu'
ModuleNotFoundError: No module named 'sqlx'
ModuleNotFoundError: No module named 'sqly'
ModuleNotFoundError: No module named 'sqlf'
ModuleNotFoundError: No module named 'sqlf'
ModuleNotFoundError: No module named 'sqlg'
SQLl query count and group by
How to insert rows in jTable?
How to sort json object?
Mysql Date Sort
ModuleNotFoundError: No module named 'falcon-sqla'
ModuleNotFoundError: No module named 'nefertari_sqla'
ModuleNotFoundError: No module named 'pyramid_sqla'
ModuleNotFoundError: No module named 'sqla_declarative'
ModuleNotFoundError: No module named 'sqla-filters'
ModuleNotFoundError: No module named 'sqla_helpers'
ModuleNotFoundError: No module named 'sqla-hierarchy'
ModuleNotFoundError: No module named 'sqla-inspect'
ModuleNotFoundError: No module named 'sqla_declarative'
ModuleNotFoundError: No module named 'sqla-filters'
ModuleNotFoundError: No module named 'sqla_helpers'
ModuleNotFoundError: No module named 'sqla-hierarchy'
ModuleNotFoundError: No module named 'sqla-inspect'
ModuleNotFoundError: No module named 'sqla_mixins'
ModuleNotFoundError: No module named 'sqla-models'
ModuleNotFoundError: No module named 'sqla-paranoid'
ModuleNotFoundError: No module named 'sqla-softdelete'
ModuleNotFoundError: No module named 'sqla-taskq'
ModuleNotFoundError: No module named 'sqla-views'
ModuleNotFoundError: No module named 'sqla-wrapper'
ModuleNotFoundError: No module named 'falcon-sqla'
How to sort chinese character in j2me?
HOW TO DISPLAY 2 ROWS OF CONTROLS
How to sort ArrayList in java
ModuleNotFoundError: No module named 'flask_sqla_debug'
ModuleNotFoundError: No module named 'pyramid_debugtoolbar_api_sqla'
ModuleNotFoundError: No module named 'sqla-filters-json'
ModuleNotFoundError: No module named 'sqla-filters-yaml'
ModuleNotFoundError: No module named 'sqla-filters-json'
ModuleNotFoundError: No module named 'sqla-filters-yaml'
ModuleNotFoundError: No module named 'sqla-psql-search'
ModuleNotFoundError: No module named 'sqla-yaml-fixtures'
ModuleNotFoundError: No module named 'flask_sqla_debug'
how to search the string arraylist contains database rows?
Maven dependency for org.umlg - sqlg-mysql-dialect version 2.1.6 is released. Learn to use sqlg-mysql-dialect version 2.1.6 in Maven based Java projects
Maven dependency for org.umlg - sqlg-mysql-dialect version 2.1.5 is released. Learn to use sqlg-mysql-dialect version 2.1.5 in Maven based Java projects
Maven dependency for org.umlg - sqlg-mysql-dialect version 2.1.4 is released. Learn to use sqlg-mysql-dialect version 2.1.4 in Maven based Java projects
Maven dependency for org.umlg - sqlg-mysql-dialect version 2.1.3 is released. Learn to use sqlg-mysql-dialect version 2.1.3 in Maven based Java projects

Ads