Transact-SQL Sorting Data in A Table Examples


Tool : Microsoft SQL Server Management Studio (SSMS)

Transact-SQL Create Database And Create Table Examples

Transact-SQL Insert Data Into Table Examples

Transact-SQL Retrieve Data From A Table Examples

Sort The Column [Name] of The Table [Departments] in Ascending Order

/* Sort the column [Name] of the table [Departments] in ascending order */

Use [SampleDB]
Go
Select * From [Departments]
Order By Name

ascend : increasing in size or importance


Sort The Column [Name] of The Table [Departments] in Descending Order

/* Sort the column [Name] of the table [Departments] in descending order */

Use [SampleDB]
Go
Select * From [Departments]
Order By Name Desc

descend : move or fall downward


張貼留言

0 留言