I would like to understand the difference between dplyr joins and sql joins. I have an open connection to an oracle database in R:
con <- dbConnect(odbc::odbc(), …)
The 1st request :
dbGetQuery(con, "select *
from result join test on result.test_1 = test.test_1
join sample on test.sample = sample.id_2") %>%
setNames(make.names(names(.), unique = TRUE) )%>%
as_tibble()
gives a tibble with 9541 rows (what I want !)
The 2nd request :
tbl(con, "result")%>%
inner_join(tbl(con, "sample"), by = c("test_1" = "id_2"))%>%
collect()
gives a tibble with 2688 rows
test_1 and id_2 are character fields with spaces in it and numbers at the end. example: “ 3333” .
Thanks