Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[解决中] mysql select: ss7.5 =>dx2 的

[复制链接]
zif2003 发表于 2011-6-28 15:43:13 | 显示全部楼层 |阅读模式
本帖最后由 zif2003 于 2011-6-28 15:44 编辑

想手工把ss 7.5的自定义模型的数据导到dx2 的门户中:
发析表格如下:

ss7.5的
  1. 表格一:
  2. supe_showitems
  3. 字段: itemid / subject  /subjectimage

  4. 表格二:
  5. supe_showmessage
  6. 字段: itemid / show_img / show_img1 / show_img2 / show_img3 / show_img4 /show_img5
复制代码

dx2.0 portal的.
  1. DX2的
  2. 表格一
  3. pre_dx2_portal_article_title
  4. 字段:

  5. aid / title / pic /  

  6. 表格二:
  7. pre_dx2_portal_article_content

  8. 字段:aid / content
复制代码





 楼主| zif2003 发表于 2011-6-28 15:47:59 | 显示全部楼层
ss7.5表格二中的 show_img0-5字段是图片相对路径,  需要将这六个路径合并写到 dx 2.0的表格二的 content字段中。
不知道要如何格式化 select时候的输出。只要解决这个, 我就可以手工的将ss7.5的数据转移到 dx2中了。
虽然还有其他字段没有转移,但那些是比较不重要的如作者用户日期点击数,不要也罢。
回复

使用道具 举报

 楼主| zif2003 发表于 2011-6-28 15:55:35 | 显示全部楼层
本帖最后由 zif2003 于 2011-6-28 15:56 编辑

ss75
表一
itemid: mediumint(8)
subject: char(80)
subjectimage: char(80)
表二
itemid: mediumint(8)
show_imgX: varchar(150)x6


dx2
表一
aid: mediumint(8)
title: varchar(255)
pic:  varchar(255)

表二:
aid: mediumint(8)
content: text
回复

使用道具 举报

 楼主| zif2003 发表于 2011-6-28 15:57:20 | 显示全部楼层
我的组别升级为 Conqueror  
回复

使用道具 举报

12153556 发表于 2011-6-28 16:45:49 | 显示全部楼层
支持一下,分享更多经验
回复

使用道具 举报

 楼主| zif2003 发表于 2011-6-28 16:59:27 | 显示全部楼层
  1. SELECT supe_showitems.itemid, supe_showitems.subject, supe_showitems.subjectimage, group_concat(supe_showmessage.show_img, supe_showmessage.show_img_1, supe_showmessage.show_img_2, supe_showmessage.show_img_3,supe_showmessage.show_img_4, supe_showmessage.show_img_5) as msgzFROM supe_showitemsLEFT JOIN supe_showmessage ON ( supe_showmessage.itemid = supe_showitems.itemid ) WHERE supe_showmessage.itemid = supe_showitems.itemid;
复制代码

奇怪..为啥这语句只显示了一条数据..

回复

使用道具 举报

 楼主| zif2003 发表于 2011-6-28 17:12:55 | 显示全部楼层
  1. SELECT supe_showitems.itemid, supe_showitems.subject, supe_showitems.subjectimage, supe_showmessage.show_img, supe_showmessage.show_img_1, supe_showmessage.show_img_2, supe_showmessage.show_img_3,supe_showmessage.show_img_4, supe_showmessage.show_img_5
  2. FROM supe_showitems
  3. LEFT JOIN supe_showmessage ON ( supe_showmessage.itemid = supe_showitems.itemid )
  4. WHERE supe_showmessage.itemid = supe_showitems.itemid
  5. LIMIT 0 , 10
复制代码
这个可以正常显示10条.
回复

使用道具 举报

 楼主| zif2003 发表于 2011-6-30 12:29:45 | 显示全部楼层
  1. INSERT INTO pre_dx2_portal_article_title(aid,title,pic) SELECT (itemid+23),subject,subjectimage FROM supe_showitems;

  2. INSERT INTO pre_dx2_portal_article_content(aid,content) SELECT (itemid+23),concat(show_img,show_img1,show_img2,show_img3,show_img4,show_img5) FROM supe_showmessage;
复制代码
这条语句成功导入.
回复

使用道具 举报

 楼主| zif2003 发表于 2011-7-8 16:07:19 | 显示全部楼层
  1. UPDATE pre_dx2_portal_article_title SET pic = replace(pic, '2009/', 'portal/2009/') ;
复制代码
  1. UPDATE pre_dx2_portal_article_title SET pic = replace(pic, '2010/', 'portal/2010/') ;
复制代码
  1. UPDATE pre_dx2_portal_article_title SET pic = replace(pic, '2011/', 'portal/2011/') ;
复制代码
这条语句将ss75的文章主题图片设置为dx2.0的门户文章主题图片的正确路径;
做更改前先备份你的数据;  ss75附件需要进行转移。  
回复

使用道具 举报

 楼主| zif2003 发表于 2011-7-8 16:12:07 | 显示全部楼层
接下来解决 pre_dx2_portal_article_content(aid,content)
content字段合并进来的NULL空数据问题。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-19 11:55 , Processed in 0.130824 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表