-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
                                                                                       
                                      
                                                                                       
                                      
> What I am trying to get is a list that shows how many records from
> 'sub_a' and 'sub_b' are referencing 'main':
                                                                                       
                                      
SELECT id,
  (SELECT COUNT(*) FROM sub_a WHERE sub_a.main_id=main.id),
  (SELECT COUNT(*) FROM sub_b WHERE sub_b.main_id=main.id)
FROM main ORDER BY id;
                                                                                       
                                      
- --
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200404092128
-----BEGIN PGP SIGNATURE-----
 
iD8DBQFAd03pvJuQZxSWSsgRAuDuAJ0elm2bPjgC1bGPHnrotzXrPKCt4ACdFytf
BglMm6IouFFZt1c19zST5ac=
=7DbY
-----END PGP SIGNATURE-----



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to