论坛首页 综合技术论坛

Mysql 3.24不兼容5.0问题

浏览 1945 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2007-09-12  
今天碰到mysql 5.0转移到 mysql 3.24上出现的sql语句错误
 
sql 代码
  1. select * from sort where id in (select id from sort where fid=10)  
 
原以为不支持in,
改用exists
sql 代码
  1. select * from sort as s where exists (select id from sort where fid=10 and id=s.id)  
还是错误
最终发现是不支持 select 结果集作为新的操作集用
ps:应该是4.0才支持子集合
 
最后只好改为内连接的方法
sql 代码
  1. select a.title,a.id from article_text as a inner join sort as s on a.sort_id = s.id where s.fid=10 and a.isIndex order by a.id desc limit 20  
  1. select * from bar_tie as t inner join ( bar_bar as b inner join bar_sort as s  ) on (t.bar_id=b.id and b.sort_id=s.id ) where s.fid in (2)  
论坛首页 综合技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics