Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old February 25th, 2004, 05:05 AM
iamvijay iamvijay is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 5 iamvijay User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old February 26th, 2004, 06:45 AM
galith_haham galith_haham is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 64 galith_haham User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 25 m 17 sec
Reputation Power: 5
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)
/

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Wanted SlNo for different name.....


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway