我试图使用下面的代码选择除前2000行以外的所有行,但是我收到以下错误.
new_table = sqldf("select units, count(*)
from old_table
group by units
where count(*) > 2000")
Error in sqliteExecStatement(con, statement, bind.data) :
RS-DBI driver: (error in statement: near "where": syntax error)
Run Code Online (Sandbox Code Playgroud)
我想你只是在寻找HAVING:
select units, count(*)
from old_table
group by units
having count(*) > 2000
Run Code Online (Sandbox Code Playgroud)