Results 1 to 3 of 3

Thread: i need help in writing a sql query

  1. #1
    Join Date
    May 2008
    Posts
    1

    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?

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Try something like:

    select top 1 count(title) most from movie where year = 2006 group by studioname order by most desc

  3. #3
    Join Date
    Jun 2008
    Posts
    1
    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
  •