Forums.Sureshkumar.net : A Perfect Place to Share Knowledge         Blogs     Games    Magazines    

"Sharing knowledge does not lessen your store, often it gets you more. Sharing plays a key role in relationships and bonding, happens in small steps and is assisted through community membership."

Go Back   SURESHKUMAR.NET FORUMS > TECHNICAL DISCUSSIONS > ORACLE , SQL SERVER , SYBASE & Others > Oracle Interview / Technical Questions
Register FAQ Members List Calendar Games Blogs Search Today's Posts Mark Forums Read

Oracle Interview / Technical Questions Kindly solve an many as questions you can. It will sharpen your skills and those solutions will help others too.

   

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 23-01-07, 09:36 PM   #1 (permalink)
Senior Member
 
Join Date: Jan 2007
Age: 27
Posts: 283
Thanks: 0
Thanked 2 Times in 2 Posts
Thanks: 0
Thanked 2 Times in 2 Posts
Rep Power: 4 radhika_btech is on a distinguished road
Sql - I have a table with duplicate names in it. Write me a query which returns only duplicate rows with number of times they are repeated.

Sql - I have a table with duplicate names in it. Write me a query which returns only duplicate rows with number of times they are repeated.
radhika_btech is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-03-08, 02:22 PM   #2 (permalink)
Junior Member
 
Join Date: Mar 2008
Age: 26
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1 ketan_kashyap@yahoo.co.in is on a distinguished road
Re: Sql - I have a table with duplicate names in it. Write me a query which returns only duplicate rows with number of times they are repeated.

Quote:
Originally Posted by radhika_btech View Post
Sql - I have a table with duplicate names in it. Write me a query which returns only duplicate rows with number of times they are repeated.
select name, count(name)
from table_name
group by name
having count(name) > 1

Last edited by ketan_kashyap@yahoo.co.in; 10-03-08 at 02:24 PM. Reason: mistake
ketan_kashyap@yahoo.co.in is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 19-09-08, 03:05 PM   #3 (permalink)
Junior Member
 
Join Date: Sep 2008
Age: 24
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1 TILAK is on a distinguished road
Thumbs up Re: Sql - I have a table with duplicate names in it. Write me a query which returns only duplicate rows with number of times they are repeated.

SELECT ID,COUNT(*) FROM EMP2 E WHERE ROWID >(SELECT MIN(ROWID) FROM EMP2 R WHERE E.ID=R.ID)GROUP BY E.ID

IF U HAVE BELOW TABLE

EMP

ID
10
10
20
20
20
TILAK is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
interview Q&A asked in winrunner Spoorthi Testing Tools & QA 80 22-11-08 11:48 PM
Mega Free Download S/W Links A-Z yathish OTHERS 513 30-09-08 02:49 PM
Some VBScript Functions.. kiran2710 Testing Tools & QA 5 11-11-07 07:05 PM
Sql - How to display duplicate rows in a table? radhika_btech Oracle Interview / Technical Questions 1 28-01-07 02:07 AM
SQL SERVER 2000 QUESTIONS.... LALIT KUMAR VB / ASP.NET Technologies 2 16-12-06 06:29 PM


All times are GMT +6.5. The time now is 09:12 PM.





Search Engine Optimization by vBSEO 3.1.0