MySQL text_fields语句问题.
可能我的问题比较简单 但是毕竟我是一个初学者.所以请各位大大可以说的详细些.. win7下 mysql版本是5.1.40 我遇到如下问题.. 我想将一个book.txt导入数据库..book.txt内容如下 isbn|title|author last|author first|copyright date| 067973452|notes from underground|dostoevsky|Fyodor|august 1944| 因为我建立的authors的表 只有author_id author_last author_first country 这四列 使用语句是: load data infile 'd:/book1.txt' replace into table authors fields terminated by '|' lines terminated by '\r\n' text_field (col1, col2, col3, col4, col5) set author_last = col3, author_first = col4 ignore col1, col2, col5, 1 lines; 本意是忽略authors表中不存在的项. 只导入author_last和author_first 但是出错..请问正确的语句应该是怎样的呢?
建议去mysql版问问引用 建议去mysql版问问 开始没找到..以转移..谢谢~ 参考手册中的例子。 用临时变量,不是 ignore SQL code: LOAD DATA INFILE 'file.txt' INTO TABLE t1 (column1, @dummy, column2, @dummy, column3); MySQL官方文档 http://dev.mysql.com/doc/refman/5.1/zh/index.html 感谢 acmain_chm的回答..
相关问答:
我对SQL SERVER和ACCESS比较熟,所以数据库的通用基础东西可以说都掌握的差不多了,我现在想要的就是以上两数据库的独特之处的介绍和应用介绍。 另外书最好对应最新版本 oracle是11g吧 10的也行;mysql是5.1吧 谢 ......
先上错误 无法联接数据库 java.sql.SQLException: Before start of result set at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910) at com.mysql.jdbc.ResultSet.checkRowPos(ResultSet.java: ......
String SQL="insert into 学生信息表 values(StudentNumber,StudentName,StudentAge)";其中StudentNumber,StudentName,StudentAge都是变量。这样写不对……到底该咋写啊 万分感谢! String SQL=&q ......
原帖请看 http://topic.csdn.net/u/20100115/09/98c6ac75-d6fe-4b6c-90dc-336a738a0c0f.html?14601 总结下就是 apache php mysql 我全部都用的是gb2312,有什么办法可以不用每次mysql_query('SET character_set_r ......
如题 补充下: 无程序,给思路也行; 1. 先判断之前的同步是否完成了。 ###如何判断? 2. 进行CHANGE MASTER TO 操作。###我知道可以切换成备份机,但是不知道如何切换回主服务器, 我的邮箱是do ......