Hi guys,
i have two tables would be joined using ref_n and because ref_n the same, if i joined using ref_n, it would create cartessian join.
How would I avoid it by having one auth person each records like example below.
i have two tables would be joined using ref_n and because ref_n the same, if i joined using ref_n, it would create cartessian join.
How would I avoid it by having one auth person each records like example below.
Code:
table1
post_id ref_n post_d
1 50 2018-10-01
2 50 2018-10-02
table2
auth_id ref_n auth_person
3 50 Nina
4 50 Bill
If I join table1 and table2 with ref_n the result would be below
post_id ref_n post_d auth_person
1 50 2018-10-01 Nina
1 50 2018-10-01 Bill
2 50 2018-10-02 Nina
2 50 2018-10-02 Bill
I would like to have result like below, one auth person each for record
post_id ref_n post_d auth_person
1 50 2018-10-01 Nina
2 50 2018-10-02 Bill