获取以下错误
sqlstate[hy000]:常规错误:1390准备语句包含太多占位符
我的查询最近由于表中的数据而变得
SELECT
*
FROM
table
WHERE col1 = 'some-val'
AND col2 NOT IN ('va1', 'val2', 80k values... )
我用的是Laravel5.6
$data_will_be_skipped = OtherModel::select('code')
->where('col1', 0)
->orWhere('col2', 1)
->groupBy('col3')
->pluck('col3')->toArray();
$data\u将被跳过\u现在约为8万个数组
Model::where('col1', 'some-val')->whereNotIn('col2', $data_will_be_skipped)->get();
1条答案
按热度按时间y0u0uwnf1#
mysql在prepared语句中的参数限制为65535个。
改用子查询: