Menu

#37 Use one query to get rows + child existence

open
data query (2)
5
2003-08-06
2003-08-06
No

Instead of using one query to get rows, and another go
get those with children, use one query to reduce
communication with the backend:

select c.composer_id,
c.composer_name,
(select count(*) from werk
where w.composer_id=c.composer_id)
as nchildren
from composer;

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.