mysql - SQL Join SQLzoo -



mysql - SQL Join SQLzoo -

there's problem on sqlzoo under more bring together operations mysql. problem asked

list films released in year 1978 ordered number of actors in cast.

the tables given follows, ord has value of 0 or 1, 1 star role.

movie | actor | casting id id movieid yr name actorid title ord budget gross director

i wrote sql query follows, sqlzoo isn't telling me have right answer, believe query correct. can verify , perchance tell me how without subquery please? thanks!

select distinct movie.title, f.num_actors (select casting.movieid,count(casting.actorid) num_actors casting grouping casting.movieid ) f bring together film on f.movieid = movie.id movie.yr = 1978 order 2 desc

you can bring together first, grouping:

select movie.* film bring together casting on movie.id = casting.movieid movie.yr = 1978 grouping movie.id order count(*) desc

mysql sql sql-server sqlite

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -