sql - Remove duplicates returning from join -
I am trying to join two tables. Each table has a unique ID, upon joining, many records have been returned (a lot of relationships). How can I avoid the duplication of records and get a match record?
The parameters used include email and date fields:
1.email, select 1.lead_id, 1.lead_date, 2.rdm_id in table_1 By joining table memory 1.email = 2.email and 1.lead_date = 2.post_date
Table 1:
email, Lead_id, lead_date 124@gmail.com, 1655535, 1/1/2013 124@gmail.com, 1655536, 1/1/2013
Table 2:
email, rdm_id, post_date 124@gmail.com, 3283370, 1/1/2013 124@gmail.com, 3283373, 1/1/2013
I like to have my output: < / P>
124@gmail.com, 1655535, 3283370, 1/1/2013 124@gmail.com, 1655536, 3283373, 1/1/2013
Worst Returning to domain:
124@gmail.com, 1655535, 3283370, 1/1/2013 124@gmail.com, 1655536, 3283370, 1/1/2013 124@gmail.com, 1655535 , 3283373, 1/1/2013 124@gmail.com, 1655536, 3283373, 1/1/2013
< P> Just use different or GRO to remove the duplicate. Choose
different ...
or
your_sql_query group by email, num1, number 2, date < / Code>
Comments
Post a Comment