摘要: 先创建一个新表,然后写语句植入即可。drop TABLE TEMP_1;CREATE TABLE TEMP_1 SELECT SUBSTR(ID,1,6) FROM node;select * from TEMP_1;看看你建的新表先。然后再写入值。CREATE TABLE TEMP_3 ( MYID VARCHAR(24) ) ;INSERT INTO TEMP_1 SELECT * FROM TEMP_1;SELECT * FROM TEMP_3;有一个更好的插入表方法,刚刚从园子里找到的,陈晨大侠的:http://www.cnblogs.com/freshman0216/archive/ 阅读全文
posted @ 2012-05-08 14:52 junjunang 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 我在运行MYSQL时,经常出现这种问题,一阵搜索后,原来问题出现在函数与括号之间的空格上。比如:写成”concat ()“ 这样就出错了,需要去掉空格“concat()”,就好了。资料来源:在这个网址找到方法:http://blog.152.org/2009/12/mysql-error-1305-function-xxx-does-not.html 阅读全文
posted @ 2012-05-08 13:54 junjunang 阅读(5005) 评论(0) 推荐(0) 编辑
摘要: 第一句:create table <temp_table1> as select * from <your_table> where <id> in ( select max(<id>) from <yourtable> group by <segment>);第二句:truncate table <your first table>;第三句:insert into <your first table> select * from <temp_table1>;一般可以另建一个字段ID,让 阅读全文
posted @ 2012-05-08 10:38 junjunang 阅读(229) 评论(0) 推荐(0) 编辑