Results 1 to 1 of 1
  1. #1
    Join Date
    Nov 2007

    Red face Unanswered: Match Query between 3 different tables


    I have 3 different tables with ID as Common field among them

    I am trying to find ID match and get the total count of records which exist in table2 and table3

    here is my query for 2 tables which is working fine

    SELECT Count(table2.GROUP_ID) AS CountOfGROUP_ID
    FROM table1 INNER JOIN table2 ON table1.GROUP_ID = table2.GROUP_ID;

    but when i add table3 to the above query, its showing the result as 0 and below is the query

    SELECT Count(table2.GROUP_ID) AS CountOfGROUP_ID, Count(table3.GROUP_ID) AS CountOfGROUP_ID1
    FROM (table1 INNER JOIN table2 ON table1.GROUP_ID = table2.GROUP_ID) INNER JOIN table3 ON table1.GROUP_ID = table3.GROUP_ID;

    any help would be appreciated

    Thanks in advance
    Last edited by sam_01; 10-12-12 at 04:32.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts