I am new to SQL and am using MonetDB to load a large file into R studio. I have loaded my data as a db using monetDB, and would now like to execute the R code below on the data in this database:
my_selection <- db_data %>% group_by(id) %>%
tally(. , sort = TRUE) %>%
my_selection <- dbGetQuery(connection,"SELECT * FROM my_table [INSERT REST OF CODE HERE]")
That's depends on the DBMS you're using ,
SELECT TOP 100 id,sum(YourOtherColumn) as sum_c FROM YourTable GROUP BY id ORDER BY sum_c DESC
SELECT id,sum(YourOtherColumn) as sum_c FROM YourTable GROUP BY id ORDER BY sum_c DESC LIMIT 100
If it's something else, tell me and I'll edit the answer.