jeudi 26 février 2015

Get reference count of reverse foreign key relations


Image I have a simple user table like this:



ID|Name
-------
12|Foo


I want to know: How many reverse foreign key relations point to the user with ID 12?


I use PostgresSQL, but a portable solution would be better ...





Aucun commentaire:

Enregistrer un commentaire