您的位置:首页 > 数据库

一次sql优化的记录

2014-07-03 15:37 316 查看
select a.band,a.name from radio as a where exists ( select radio.id from radio,(select radio_nj.radio_id as radio_id from user,radio_nj where user.role != 5 and user.id = radio_nj.user_id) as b where radio.id = b.radio_id )

select a.band,a.name from radio as a where a.id in (select radio_nj.radio_id from user,radio_nj where user.role != 5 and user.id = radio_nj.user_id);

同样的效果,前面那条只需要0.5秒 后面那条半天没有没出来
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: