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 / pooja gupta

select f1.a, f2.d from
(select f1 as a from t order by 1) f1,
(select f1 as d from t order by 1 desc)f2

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you select everything, but 1 or 2 fields, without writer's cramp?

977


what are null values? : Sql dba

946


In what condition is it good to disable a trigger?

1003


What is the use of primary key?

1004


how would you get the current date in mysql? : Sql dba

961


In pl/sql, what is bulk binding, and when/how would it help performance?

986


What is pl sql commands?

1038


Difference between table function and pipelined function?

1011


How do you use collections in procedure to return the resultset?

2236


How we can update the view?

1043


What are hotfixes and patches?

941


What is localdb mssqllocaldb?

1064


Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10

2107


how to run 'mysql' commands from a batch file? : Sql dba

1105


discuss about myisam key cache. : Sql dba

1012