今天碰到mysql 5.0转移到 mysql 3.24上出现的sql语句错误
sql 代码
- select * from sort where id in (select id from sort where fid=10)
原以为不支持in,
改用exists
sql 代码
- select * from sort as s where exists (select id from sort where fid=10 and id=s.id)
还是错误
最终发现是不支持 select 结果集作为新的操作集用
ps:应该是4.0才支持子集合
最后只好改为内连接的方法
sql 代码
- 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
- 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)
本文记录了从MySQL5.0迁移到MySQL3.24过程中遇到的问题及解决办法,详细介绍了如何调整SQL语法以适应旧版数据库,并提供了解决方案。
211

被折叠的 条评论
为什么被折叠?



