In this forum you can share stuff related to Oracle 11g, 10g, 9i.
srinu_a47
Posts: 16 Joined: Fri Feb 23, 2007 7:02 am
Location: India
Post
by srinu_a47 » Tue Mar 06, 2007 9:14 am
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 » Tue Mar 06, 2007 11:25 pm
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 » Wed Mar 07, 2007 1:40 am
create a function with loop and in loop concat variable value to lloing value return concatednated variable
Users browsing this forum: No registered users and 0 guests