我有一个.csv文件需要插入到数据库表中使用。这是我正在使用的查询..
LOAD DATA INFILE 'C:\Users\vikas\Desktop\UserDetails.txt' INTO employee_users FIELDS TERMINATED BY ',' LINES TERMINATED BY ''(@UserName,@EmpID,@DepName,@MailId,@MonthlyQuota)
但我收到了错误。
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'employee_users FIELDS TERMINATED BY ',' LINES TERMINATED BY ''(@UserName,@EmpI' at line 1
请帮我解决这个问题。
答案 0 :(得分:1)
您可以尝试在employee_users
之前添加表吗?LOAD DATA INFILE 'C:\Users\vikas\Desktop\UserDetails.txt' INTO TABLE employee_users FIELDS TERMINATED BY ',' LINES TERMINATED BY ''(@UserName,@EmpID,@DepName,@MailId,@MonthlyQuota)