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

What is dba in sql? : SQL DBA

1034


What is sql key?

977


What are the three pl sql block types?

1000


Are stored procedures faster than dynamic sql?

1024


Which are the different types of indexes in sql?

1053


how to increment dates by 1 in mysql? : Sql dba

971


discuss about myisam index statistics collection. : Sql dba

942


Explain the the delete statements in sql?

1052


What are the different types of triggers?

1128


What is the advantage of index in sql?

960


Which is the correct statement about truncate and delete?

1103


which operator is used in query for pattern matching? : Sql dba

998


who introduced sql?

1006


How many types of indexes are there in sql?

977


Differentiate between sga and pga.

1155