Home » SQL & PL/SQL » SQL & PL/SQL » doubts in suquery
doubts in suquery [message #203206] Tue, 14 November 2006 05:54 Go to next message
oracleram
Messages: 23
Registered: November 2006
Junior Member
hi to every1,

i have doubts,plz clarify me,
am having two tables say A,B

A table contains B table contains

ID NAME ID
1 a 1
2 b 2
3 c 2 have to find the no.of.duplicates in B table,no.of.times they are repeate by using sub queries.

for example,output as 2 2
Re: doubts in suquery [message #203208 is a reply to message #203206] Tue, 14 November 2006 06:00 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,

is this what you wanted.

select t2.id,count(*) from b t2 join a t1 on t2.id=t1.id
group by t2.id having count(*)>1


regards,
Re: doubts in suquery [message #203210 is a reply to message #203206] Tue, 14 November 2006 06:03 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Do not report your own messages to the moderators.
Previous Topic: Schema v/s Database
Next Topic: Create package in another schema without using 'ALTER ANY PROCEDURE' privilege
Goto Forum:
  


Current Time: Mon Dec 05 06:40:26 CST 2016

Total time taken to generate the page: 0.16329 seconds