CREATE TABLE TblGen_ROW_NUMBER
(
Name VARCHAR(100),
City VARCHAR(100)
)
INSERT INTO TblGen_ROW_NUMBER(Name,City)VALUES('PABITRA','BHUBANESWAR')
INSERT INTO TblGen_ROW_NUMBER(Name,City)VALUES('ASHWIN','CUTTACK')
INSERT INTO TblGen_ROW_NUMBER(Name,City)VALUES('ARRYA','NAKHARA')
SELECT ROW_NUMBER() OVER(ORDER BY Name)AS ID, Name,City FROM TblGen_ROW_NUMBER
SELECT ROW_NUMBER() OVER(ORDER BY Name DESC)AS ID, Name,City FROM TblGen_ROW_NUMBER
No comments:
Post a Comment