Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

take one table is t1 and in that column name is f1
f1 column values are
200
5000
3000
7000
300
600
100
400
800
400
i want display the values asc and desc in a single output.
sample output is
f1.a
100
200
300
400
500
600
etc......
and f1.d is
5000
4000
3000
2000
1000
etc...

Answer Posted / jitendra

#The ORDER BY keyword is used to sort the result-set by a #specified column.
#The ORDER BY keyword sort the records in ascending order by #default.
#If you want to sort the records in a descending order, you #can use the DESC keyword.

#1. display the values ascending order

SELECT f1 FROM t1 ORDER BY f1 AS f1.a

#2. display the values descending order

SELECT f1 FROM t1 ORDER BY f1 DESC AS f1.d

Is This Answer Correct ?    0 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we create clustered index without primary key?

948


Does sql*plus also have a pl/sql engine?

1068


Does group by remove duplicates?

1021


What are pl/sql cursors?

1037


What do you mean by “trigger” in sql?

1055


How to run sql statements through the web interface?

1021


what is an extent ? : Sql dba

1073


What is sql partition?

1083


Suppose a student column has two columns, name and marks. How to get name and marks of the top three students.

994


Explain the difference between drop and truncate commands in sql?

1022


what are the non-standard sql commands supported by 'mysql'? : Sql dba

1098


How do you declare a variable in pl sql?

1009


What is a temporal table?

916


how can we submit a form without a submit button? : Sql dba

964


What is dense_rank in sql?

957