loannumber<-sqlQuery(ch,"SELECT LOAN# FROM srvdsrl1")
这是一个ODBC表,字段名称是LOAN#
这是错误
[1] "42S22 1054 [MySQL][ODBC 5.3(w) Driver][mysqld-5.6.22]Unknown column 'LOAN' in 'field list'"
[2] "[RODBC] ERROR: Could not SQLExecDirect 'SELECT LOAN# FROM srvdsrl1'"
答案 0 :(得分:0)
这是一个比R更多的数据库问题。对于MySQL(可以从错误描述中扣除),应该引用带有特殊字符的列:'LOAN#'
。见Special Characters in MySQL Table Name