以下代码行:
sqldf("UPDATE q1_sql_1 SET MONTH_YEAR = RIGHT(MONTH_YEAR, LEN(MONTH_YEAR) - 4)")
显示此错误:
Error in rsqlite_send_query(conn@ptr, statement) : near "(": syntax error
答案 0 :(得分:1)
使用length
和rightstr
。对于SQLite中可用的函数,请参阅:
https://www.sqlite.org/lang_corefunc.html
以及RSQLite提供的贡献函数:
https://github.com/ggrothendieck/sqldf#example-15-use-of-rsqliteextfuns-library-functions