Skip to content
Advertisement

postresql query to check no. of documents is 4

I have a master table for applications and another table for documents upload, I want the count of applications which has 4 documents in document table.

master application table=>application_ht_install and Documents table=>bescom_appl_upload_doc ack_no is the primary key for application_ht_install and foreign key for application Documents.

And doc_id is for the document id, Help me out guys

the above query gives count for application with documents, and I want count of application in application_ht_install which has 4 documents in bescom_appl_upload_doc

Advertisement

Answer

here is one way :

replace a.id = b.id with right connection between tables

well, that would be a new question but I answer it here anyways:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement