Getting following error
SQLSTATE[HY000]: General error: 1390 Prepared statement contains too many placeholders
My query has become due to data in the table recently
SELECT
*
FROM
table
WHERE col1 = 'some-val'
AND col2 NOT IN ('va1', 'val2', 80k values... )
I am using Laravel 5.6
$data_will_be_skipped = OtherModel::select('code')
->where('col1', 0)
->orWhere('col2', 1)
->groupBy('col3')
->pluck('col3')->toArray();
$data_will_be_skipped is now approx 80k arrays
Model::where('col1', 'some-val')->whereNotIn('col2', $data_will_be_skipped)->get();
not in
array ? if they are from some tables in the DB only. consider using joins instead ofnot in
. Whether using laravel or not,not in
itself has packet size limits