以下代码行:
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
以下代码行:
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
使用length
和rightstr
。有关 SQLite 中可用的功能,请参阅:
https://www.sqlite.org/lang_corefunc.html
对于 RSQLite 也提供的贡献函数:
https://github.com/ggrothendieck/sqldf#example-15-use-of-rsqliteextfuns-library-functions