I need a query to select all rows where it selects all rows based on multiple product ids in products and exclude products with ids as well and include the blank ones as well.
See the image for more details
I have written a query but the blank ones are getting ignored.
select
from discounts
where (
FIND_IN_SET('52238403',products)
or FIND_IN_SET('52238407',products)
or FIND_IN_SET('52238408',products)
)
and
(
FIND_IN_SET('52238403',exclude_products)=0
and FIND_IN_SET('52238407',exclude_products)=0
and FIND_IN_SET('52238408',exclude_products)=0
)
Any help is much appreciated.
Thanks