DPLYR SQL Left Join

Viewed 33

I have this one from SQL but i don't know how to deliver with dplyr in R. I try but the column that I hope not like that

select a.*, b.*, c.FLAG, c.MONTH, c.DATE from APPLICATION a 
left join CURL b on a.NO = b.NO 
left join WO c on a.NO = c.NO

Can you fixed this?

ab <- APPLICATION %>% left_join(CURL, by = c("NO" = "NO")) %>% 
                      left_join(WO , by = c("NO" = "NO"))  %>%
                      select(names(APPLICATION), names(CURL), FLAG, MONTH, DATE)
1 Answers

If the column you are joining on has the same name NO, you need not write by=c('NO'='NO'). Just by='NO' should be enough.

Related