-
i need help in writing a sql query
i have a relation
Movie(title,year,length,filmtype,incolor,studionam e,producer)
Now i want to write a SQL query that shows me only the name of the studio
that has produced most movies in year 2006.
How can i do that using SQL query?
-
Try something like:
select top 1 count(title) most from movie where year = 2006 group by studioname order by most desc
-
try this:
select temp.studioname ,max(temp.mvcount) from (select studioname,count(title) as mvcount from movie where year = 2006 groupby studioname) temp;
Last edited by ravipoddar.bit; 06-17-2008 at 01:41 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|