Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> SQLServer to Oracle
This query works in MS SQL Server but not in Oracle 8. Any suggestions
how to achieve the samething in Oracle?
SELECT TPARENT.id, TPARENT.name
(SELECT COUNT(*) FROM TPARENT, TCHILD WHERE TCHILD.parentid = TPARENT.id) AS numchildren
FROM TPARENT Basically, I have two tables TPARENT and TCHILD. TCHILD has a FK parentid to TPARENT.id. I want a list of all parents and the number of children they have.
Any insights would be appreciated.