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
 question

Author  Topic 

chollette
Starting Member

1 Post

Posted - 2010-03-30 : 04:38:22
i am new to database. i need help in solving the OLAP query syntax problem below;

1. find the number of publication for different types of publication (journal, conference, book) for each faculty in the university, for the last five years.

below is my solution but not sure is right

SELECT facultyNo,publicationType,yearmonth,COUNT(*) AS pubcount
FROM faculty,publishedpapers,publicationlist
WHERE faculty.facultyNo = publicationlist.facultyNo
AND publishedpapers.publicationnNo = publicationtlist.publicationNo
AND publishedpapers.publicationtype = ('journal','conference','book')
AND publicationlist.yearmonth BETWEEN ('1-JAN-2005' AND '31-DEC-2009')
GROUP BY ROLLUP(facultyNo,publicationtype,yearmonth,pubcount);

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-03-30 : 13:14:07
post some sample data and explain what you want. thats much better than posting query

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -