|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Wanted SlNo for different name.....
Select Name, Sal From
(Select 'A' Name, 1 Sal From Dual Union Select 'A' Name, 2 Sal From Dual Union Select 'A' Name, 3 Sal From Dual Union Select 'B' Name, 11 Sal From Dual Union Select 'C' Name, 111 Sal From Dual Union Select 'C' Name, 222 Sal From Dual Union Select 'D' Name, 1111 Sal From Dual Union Select 'D' Name, 2222 Sal From Dual Union Select 'D' Name, 3333 Sal From Dual Union Select 'D' Name, 4444 Sal From Dual Union Select 'D' Name, 5555 Sal From Dual) which will return output like Name SAL ---- ---------- A 1 A 2 A 3 B 11 C 111 C 222 D 1111 D 2222 D 3333 D 4444 D 5555 I want one more column which will display no. for each name like No Name SAL -- ---- ---------- 1 A 1 1 A 2 1 A 3 2 B 11 3 C 111 3 C 222 4 D 1111 4 D 2222 4 D 3333 4 D 4444 4 D 5555 can anyone help me thanx in advance vijay |
|
#2
|
|||
|
|||
|
Select rownum,Name, Sal From
(Select 'A' Name, 1 Sal From Dual Union Select 'A' Name, 2 Sal From Dual Union Select 'A' Name, 3 Sal From Dual Union Select 'B' Name, 11 Sal From Dual Union Select 'C' Name, 111 Sal From Dual Union Select 'C' Name, 222 Sal From Dual Union Select 'D' Name, 1111 Sal From Dual Union Select 'D' Name, 2222 Sal From Dual Union Select 'D' Name, 3333 Sal From Dual Union Select 'D' Name, 4444 Sal From Dual Union Select 'D' Name, 5555 Sal From Dual) / |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Wanted SlNo for different name..... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|