Sorting Problem while generating table dynamically ? [message #392255] |
Tue, 17 March 2009 03:25  |
rangan.s
Messages: 75 Registered: February 2008 Location: chennai
|
Member |
|
|
Hi,
I am having table test_15 which is populated dynamically.i want to sort that table.
pls help
create table test_15( no int, name varchar(15),age int,dept varchar(10));
insert into test_15 values (1,'AAA',15,'A');
insert into test_15 values (2,'BAA',16,'A');
insert into test_15 values (3,'CAA',18,'A');
insert into test_15 values (4,'DAA',19,'A');
insert into test_15 values (5,'EAA',24,'B');
insert into test_15 values (6,'FAA',23,'B');
insert into test_15 values (7,'GAA',26,'C');
insert into test_15 values (8,'HAA',27,'C');
SQL> select * from test_15;
NO NAME AGE DEPT
--------------------------------------- --------------- --------------------------------------- ----------
1 AAA 15 A
2 BAA 16 A
3 CAA 18 A
4 DAA 19 A
5 EAA 23 B
6 FAA 24 B
7 GAA 25 C
8 HAA 26 C
i want to change the order for dept B alone in descending order
how to do it
i am populating this table dynamically .
Thanks
Rangan S
[Updated on: Tue, 17 March 2009 03:49] by Moderator Report message to a moderator
|
|
|
|
Re: Sorting Problem while generating table dynamically ? [message #392266 is a reply to message #392255] |
Tue, 17 March 2009 04:02   |
joicejohn
Messages: 327 Registered: March 2008 Location: India
|
Senior Member |
|
|
@rangan.s,
No contradictions there with Frank's reply but can you clarify what you meant by the following?
rangan.s wrote on Tue, 17 March 2009 13:55 |
i want to change the order for dept B alone in descending order
how to do it
|
So does that mean Dept B should be in descending order and all the other departments(Dept A and C) should be in ascending order?Also, based on what column are you ordering?
[Edit: typo]
Regards,
Jo
[Updated on: Tue, 17 March 2009 04:03] Report message to a moderator
|
|
|
Re: Sorting Problem while generating table dynamically ? [message #392267 is a reply to message #392259] |
Tue, 17 March 2009 04:21   |
rangan.s
Messages: 75 Registered: February 2008 Location: chennai
|
Member |
|
|
I am expecting the result should be
SQL> select * from test_15;
NO NAME AGE DEPT
--------------------------------------- --------------- --------------------------------------- ----------
1 AAA 15 A
2 BAA 16 A
3 CAA 18 A
4 DAA 19 A
6 EAA 24 B
5 FAA 23 B
7 GAA 26 C
8 HAA 27 C
|
|
|
|
|
|
|
|
|