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 / innaci

select a,d from (select a,d,rownum as n from (select f1.a,
f2.d from
(select f1 as a from sample1 order by 1) f1,
(select f1 as d from sample1 order by 1 desc) f2) temp)
temp1 where mod(n,(select count(f1) from sample1)+1)=1

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of using pl/sql?

1150


How do you remove duplicates without using distinct in sql?

984


What does closing a cursor do?

1328


Why is sql better than hql?

1000


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

1127


What is scalar data type in pl sql?

1075


Explain how you can copy a file to file content and file to pl/sql table in advance pl/sql?

1011


How can check sql version from command line?

1090


What is a full join?

996


Write the command to remove all players named sachin from the players table.

1185


How do I view a sql database?

1023


how to use 'mysql' to run sql statements? : Sql dba

1059


How do I make my sql query run faster?

948


what is blob? : Sql dba

1155


What does pragma mean?

1062