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
 display paper co authored from same department

Author  Topic 

ngquochung
Starting Member

13 Posts

Posted - 2006-11-27 : 09:10:14
How to display the paper number that is co authored by authors from the same department?
The database structure:
Department(DeptNum, Descrip, Instname, DeptName, State, Postcode)
Academic(AcNum, DeptNum, FamName, GiveName, Initials, Title)
Paper(PaNum, Title)
Author(PaNum, AcNum)
Field(FieldNum, ID, Title)
Interest(FieldNum, AcNum, Descrip)
Thanks for help a lot

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-27 : 09:13:48
[code]SELECT a.PaNum
FROM Author a
INNER JOIN Academic c ON c.AcNum = a.AcNum
GROUP BY a.PaNum
HAVING MIN(c.DeptNum) = MAX(c.DeptNum)[/code]

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-27 : 09:15:48
With regards to this
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=75404
and this
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=75110

you know this is a SQL Server forum? Which class are you taking?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-11-27 : 10:05:55

Learn SQL

http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -