I've been using dplyr with dbplyr to generate queries for my sql server and pull the data, but I couldn't find a way to execute the NOT IN
sql command.
I'm trying to generate something like this
SELECT * FROM EMPLOYEE WHERE ID NOT IN id_list
where id_list is obtained from another query in dplyr
id_list <- mutate(uid = distinct(id)) %>% select(uid) %>% collect()
id_list
is a tbl_Microsoft SQL Server object.
What is the dplyr code to generate the SQL query?