热门服务
众多企业的选择
网站维护
2024-04-11
次
wordpress翻译插件
外贸网站
select `a`.`id` AS `id`,`a`.`cate_id` AS `cate_id`,`a`.`title` AS `title`,`a`.`seotitle` AS `seotitle`,`a`.`keywords` AS `keywords`,`a`.`description` AS `description`,`a`.`note` AS `note`,`a`.`hits` AS `hits`,`b`.`val` AS `val` from (`yb`.`cms_list` `a` join `yb`.`cms_list_c` `b`) where (`a`.`id` = `b`.`id`)下面是存储过程:
CREATE DEFINER=`root`@`localhost` PROCEDURE `insert_into_tables`()BEGIN declare done INT DEFAULT FALSE; declare v_title VARCHAR(255); declare v_keywords VARCHAR(255); declare v_description LONGTEXT; declare v_hits INT(10); declare v_val MEDIUMTEXT; declare cur CURSOR FOR select title,keywords,description,hits,val FROM news_view; declare CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; OPEN cur; read_loop: LOOP FETCH cur into v_title,v_keywords,v_description,v_hits,v_val; IF done THEN LEAVE read_loop; END IF; insert into cf_1_news (catid, title,keywords,description,hits,status,uid,author,link_id,tableid) VALUES (999, v_title,v_keywords,v_description,v_hits,1,1,"danhanshang",0,0); insert into cf_1_news_data_0 (id,uid, catid,content) VALUES (LAST_insert_ID(),1,999, v_val); END LOOP; CLOSE cur;END
【版权声明】:本站内容来自于与互联网(注明原创稿件除外),供访客免费学习需要。如文章或图像侵犯到您的权益,请及时告知,我们第一时间删除处理!谢谢!