Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 sql query

Author  Topic 

jutiyi
Starting Member

9 Posts

Posted - 2008-02-27 : 06:19:17
How to implement in sql for the following

table Researcher - ID,Name
ReseachPaper - ResearchPaperID, MemberID

Select top three research whose produce most research paper

Thanks..

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2008-02-27 : 06:45:18
What have you tried so far?

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL or How to sell Used Cars
For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-02-27 : 06:59:19
quote:
Originally posted by jutiyi

How to implement in sql for the following

table Researcher - ID,Name
ReseachPaper - ResearchPaperID, MemberID

Select top three research whose produce most research paper

Thanks..



Join the two tables based on common field and find the number of papers occuring for a single Research (you have a function called COUNT() to do this). Take only the topmost 3 records based on count value. (you have TOP & ORDER BY clauses to do this). Now try to write the query and let us know how you got on.
Go to Top of Page
   

- Advertisement -