plz send me the query ans

In this forum you can share stuff related to Oracle 11g, 10g, 9i.
Post Reply
srinu_a47
Posts: 16
Joined: Fri Feb 23, 2007 7:02 am
Location: India

plz send me the query ans

Post by srinu_a47 »

i cerated a table 'num' in that table i create a column 'sno'.
In that colum i enter the numbers 1 to 10.
my required output is
1 2 3 4 5 10 9 8 7 6

plz tell me how to display above output using sql
shhuang
Posts: 7
Joined: Thu Aug 24, 2006 6:31 am
Location: Taiwan

Post by shhuang »

maybe this is not a perfect idea........share to everyone

select * from (
select sno
from num
where sno <= 5
order by sno asc)
union all
select * from (
select sno
from num
where sno > 5
and sno <= 10
order by sno desc)
ahmadbilal
Posts: 615
Joined: Mon Sep 18, 2006 1:32 am
Location: United Arab Emirates
Contact:

Post by ahmadbilal »

create a function with loop and in loop concat variable value to lloing value return concatednated variable
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests