title: Getting the count of column by joinning the tables
body: <p><img src="https://i.stack.imgur.com/aJeBw.jpg" alt="enter image description here"></p>
  
  <p>I have below three tables which are joined among themselves. The tables names are </p>
  
  <ul>
  <li>ioa_invoice_line</li>
  <li>ioa_invoice_line_notes</li>
  <li>IOA_INV_LINE_NOTE_MAP</li>
  </ul>
  
  <p>An image is attached which will graphically shows you the relationship. I am trying to get the count of <code>inv_line_note_id</code> from the <code>IOA_INV_LINE_NOTE_MAP</code> table with respect to each id column in the <code>ioa_invoice_line</code> table. Please advise how to get the count of column <code>inv_line_note_id</code> of <code>IOA_INV_LINE_NOTE_MAP</code> table with context to id column in the <code>ioa_invoice_line</code> table .</p>
  
  <p>As advised I have added sample data:</p>
  
  <p><strong>IOA_INVOICE_LINE</strong>:</p>
  
  <pre><code>ID             VERSION
  1234            Abc
  </code></pre>
  
  <p><strong>IOA_INVOICE_LINE_NOTES</strong>:</p>
  
  <pre><code>ID       INLI_ID        NOTES
  345      1234           Aqou
  </code></pre>
  
  <p><strong>INV_LINE_NOTE_MAP</strong>:</p>
  
  <pre><code>ID      INV_LINE_NOTE_ID          ATTACHMENT
  23            345                   rtfffr
  24            345                   fhgygg
  </code></pre>
  
  <p>So as shown above that with respect to invoice_line, column id 1234 count of column <code>Attachment</code> of <code>inv_line_note_map</code> table is <code>2</code> </p>
  
  <p>So please advise how can I count the value of column attachment of  <code>inv_line_note_map</code> table with respect to column id of the invoice line table and if there is no count then it should return <code>0</code>.</p>
  
  <p>I have tried the below things but it is not the expected solution so please advise </p>
  
  <pre><code>select * from IOA_INV_LINE_NOTE_MAP where inv_line_note_id =66060
  select * from ioa_invoice_line_notes where inli_id = 97750
  select * from ioa_invoice_line where id = 97750 ;
  </code></pre>