estoy haciendo un select que me llena un grid y todo bien, pero quiero que no me traiga los productos con id 9998 y 9999
todo lo demas si, pero no se como integralo en mi query, me podria ayudar, ante mano gracias
SELECT u.id, u.nombre as nombre, u.apellidos as apellido, u.roleId, p.price as precio,o.quantity as cantidad, r.name as rol, o.productName as productos, sum(o.quantity*o.price) as venta, count(distinct b.id) as cuentas
FROM bills b join usersoperacion u on(u.id=b.userIdAbrio and u.restId=b.restId) left join roles r on(r.id=u.roleId) join orders o on(o.restId=b.restId and o.billId=b.id) join products p on (o.restId=p.restId and o.productId=p.id) left join categories c on(p.categoryId=c.id and p.restId=c.restId) left join supercategories s on(c.superCategoryId=s.id and s.restId=c.restId)
WHERE b.statusId=2 and o.createTime between '$fechaInicio' and '$fechaFinal' and b.restId=$restId and o.statusId!=4 $s $c $p
GROUP BY u.id, o.productName
ORDER BY o.productName, venta desc
and p.id not in (9998, 9999)
en el where.