同一套代码,同一个数据库,线上跑,where条件不生效,本地跑正常,
sql: select a.* from table1 a left join table2 b on a.id=b.userId where a.score > 0
同一套代码,同一个数据库,线上跑,where条件不生效,本地跑正常,
sql: select a.* from table1 a left join table2 b on a.id=b.userId where a.score > 0
首先你要获取不同环境的执行计划再来分析
explain analyze
select a.* from table1 a
left join table2 b
on a.id=b.userId
where a.score > 0
不生效?看日志了吗 打印的sql有where条件吗