各位大侠,我有如下一段程序,目的是从一个数据框df 中提取part_num="P0001" 的数据,但应该如何在P0001上加是个" "呢??
感谢帮助!
sql_str<-paste('select part_num as part_num,ord_lt as lt from df where part_num==',as.character(order_behave[1,1]))
sql_str
[1] "select part_num as part_num,ord_lt as lt from df where part_num== P0001"
sqldf(sql_str)
错误: no such column: P0001