I have a SQL query that includes a subquery to filter for some entries:
SELECT *
FROM tbl
WHERE a > someValue AND b IN (
SELECT b
FROM tbl
WHERE a > someValue AND c == someValue
GROUP BY c, d
)
Using dplyr I would start by:
tbl(tbl) %>%
filter(a > someValue)
But I am not sure about what is the best way to execute the subquery. I don't want to use a left_join on tbl itself since its performance is inferior.