9 Replies Latest reply: Sep 4, 2015 7:02 AM by Kumar Pramod RSS

    Association between two tables

    Kumar Pramod

      Hi all,

      I have signupactivity  table in this i have used invitation_id to make association with many other different tables in the app.

       

      Now i need to do association with useractivity table where it consists user_id.

      when i used user_id to make association with both the table. I am getting sync table because signupactivity  table has invitation_id which has association with many other table.


      how can i achieve association with these two tables without sync table?

       

      signupactivity table:

      invitation_id     user_id     email_type   user_signed

       

      useractivity table:

      user_id      email_type    status

       

      I need association between these two tables because i need a count email_type.

      signupactivity table email_type has types 44,45,46,47

      useractivity table email_type has types 2,3,4,8


      Now i need to create a pivot table where it shows the count of email_type according to email types in one column like below.


      email_type          count

      44                       100

      45                        97

      46                        24

      47                        86

      2                          15

      3                          12

      4                           7

      8                           9

       

       

      Please anyone help to achieve this.

      Advance thanks,

       

      Regards,

      Pramod