d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Need Simple Help With Database Script > Pls
Add Reply New Topic New Poll
Member
Posts: 4,534
Joined: Oct 31 2006
Gold: 1.50
Feb 13 2015 04:19pm
I am just getting into Oracle DB scripting and the
the questions sound:
How many movies do not have information about genre?

I've tried this

select count(movie_id) from db.genre
where count(distinct genre) > 8;

but it returns and error:
Error code 934, SQL state 42000: ORA-00934: group function is not allowed here

the tabels are:
movie(id, title, year, kind, runtime, rating)
genre(movie_id, genre)


Would be lovely if someone could help me ;p
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Feb 13 2015 05:02pm
You want to select the movies which do not have their ID's inside the genre table. So something like:

Code
select count(m.id) from movie m, genre g, where m.id not like g.movie_id


Or something similar to that.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll