求一sql语句,感觉有点麻烦 本帖最后由 www130139 于 2012-02-25 11:46:09 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 嘿嘿,这个sql我也不会啊,不过若是一次性的话,可以用程序脚本操作啊,先查出cc_news的记录信息,在查第二章表的,有规律的话可以用like;满足就修改吧!期待sql! tryupdate cc_hits,cc_news set cc_hits.catid=cc_news.catid where cc_hits.hitsid = concat('c-1-',cc_news.id); update cc_hits a inner join cc_news b on b.id=right(a.hitsid,1) set a.catid=b.catid 楼上强大~ 建议将right改成substring_indexupdate cc_hits a inner join cc_news bon b.id=substring_index(a.hitsid,'-',-1) set a.catid=b.catid substring_index 比较方便,效率也高一些。 求助:orcale库迁到mysql后性能低下问题~~~~ 有没有一本像《How Tomcat works》这样介绍mysql运行机理的书? mysql 默认值的问题 mysql 数据库 一张表 可以存多少条数据? mysql_real_connect()函数报错,debug进去之后所有字段都是0xCCCCCCCC,错误号1251 ORACLE to mysql数据迁移问题 请教大家一个很常见的select MySQL中如何实现两个表的查询? 合并字段 MySQL有没有一种机制,当某些数据更新时,通知连接到MySQL的应用程序? mysql数据库转移 sql求出差天数问题。看似简单
update cc_hits,cc_news set cc_hits.catid=cc_news.catid where cc_hits.hitsid = concat('c-1-',cc_news.id);
on b.id=right(a.hitsid,1) set a.catid=b.catid
on b.id=substring_index(a.hitsid,'-',-1) set a.catid=b.catid