SQL: print the address of the publisher who has published only one book -


tables:

auth(auth, age), book(title,auth,pubname), publ(pubname,address) 

i attempting come query print address of publisher has published 1 book here attempt, please correct me if wrong: not homework, part of study guide upcoming test.

select address  publ  pubname    in ( select pubname         book         group pubname           having count(*) = 1) 

i think right not sure.

inner join group query solve problem.

select address from publ pb  inner join  (select pubname     book   group pubname   having count(*) = 1) b on b.pubname = pb.pubname 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -