answersLogoWhite

0

You can sort the results of a query by using the order by clause.

Ex: Select * from tbl_employee order by emp_num

The above query would sort the results by the employee number and display them. The default sort is ascending order.

Ex: Select * from tbl_employee order by emp_num desc

The above query would sort the results by descending order of employee number and display them.

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

What is the use of the SQL sort?

The use of sorting information in SQL is to organize database query results. Typically the data can be sorted in either ascending or descending order. The "Order By" command can be used to sort data in SQL by multiple columns.


What are the differences between SQL statement to iSQL plus statement?

Structured Query Lanaguage(SQL) is a command language to communicate with oracle server.whereas SQL*PLUS is an oracle tool that recognises and submits sql statements to the oracle server for execution.


What is the error in this SQL statement?

You need to tell us what the statement is - in order for us to help you !


What is the abbreviation for statement?

Statement can be abbreviated to STMT. It is not widely used, but it appears SQL code.


What does a SQL Delete statement allow?

An SQL Delete statement is a code used for programming. It allows you to delete a single record or multiple records from a graph or table. These codes can be very useful.


What are the are two sort functions for columns in SQL?

Asc & desc


How do you do a select statement within a select statement in sql?

A memo is a useful tool to provide a record of communication.


Which SQL statement is used to extract data from a database?

"SELECT" statement is used to extract the infromation from a database.


Which sql statement is used to update data from a database?

The SQL statement used to update data in a database is the UPDATE statement. It allows you to modify existing records in a table by specifying the columns and values to be updated based on certain conditions.


Can you explain how to use the SELECT statement in SQL to perform mathematical operations on data in a database table?

Yes, in SQL, you can use the SELECT statement along with mathematical operators like , -, , / to perform calculations on data in a database table. For example, you can add, subtract, multiply, or divide values from different columns or apply functions to calculate results. Just include the mathematical operation within the SELECT statement to perform the desired calculation.


Which SQL statement is used to update data in a database?

The SQL statement used to update data in a database is the "UPDATE" statement. It allows you to modify existing records in a table by specifying the column and value you want to update based on certain conditions. Additionally, you can use the "SET" keyword to assign new values to specific columns in the table.


Which SQL statement is used to insert new data in a database?

Insert into