"if you encounter any errors in SAP, send me a screenshot at pramod@learntosap.com, and I will help you resolve the issue."

SQL ORDER BY Key-word

SQL TUTORIALS-

SQL ORDER BY Key-word

Introduction-


Trulli Trulli

ORDER BY keyword in SQL is used to sort the result set of a query by one or more columns. You can sort the data in ascending (ASC) or descending (DESC) order...


✅ 🔹 Syntax:


SELECT column1, column2, ...
FROM table_name
ORDER BY column1 [ASC | DESC], column2 [ASC | DESC], ...;

Result Show :-

Emoji Examples in HTML

🔸 Example Table: Employees


ID Name Salary
1 ANNI 10000
2 SUJAN 8000
3 BOULT 5000

✅ Example:- Sort by Salary (Ascending):-

SELECT Query :-


SELECT * FROM Employees
ORDER BY Salary;

Result Show :-

Emoji Examples in HTML

🔸 Example Table: Employees

ID Name Salary
3 BOULT 5000
1 ANNI 10000
2 SUJAN 8000

✅ Example -Sort by Name (Descending):-

SELECT Query :-


SELECT * FROM Employees
ORDER BY Name DESC;

Result Show :-

Emoji Examples in HTML

🔸 Example Table: Employees

ID Name Salary
3 BOULT 5000
2 SUJAN 8000
1 ANNI 10000

May Be Like Important Link-

-Chart Of Account-OB13

-Define Plant-OX1

-Chart Of Account-OB13

-Define Financial Statement