Home > Blockchain >  MySql Where: get which criteria are not met against a record
MySql Where: get which criteria are not met against a record

Time:12-30

is there any way to get a list of reasons when a record in table is not selected from the query? For example, I have this select * from products where color=blue and price=200 and the record with id=5 is not included in the results. How can I print which criteria is false and the record with id=5 is not selected?

CodePudding user response:

I usually just copy the where criteria into the select columns, and select the particular id that wasn't returned, like:

select color=blue, price=200
from products
where id=5
  • Related