Can someone tell me why when I execute this query SELECT unt_name, unt_isDefault, uct_type FROM param_unit, unit_category WHERE param_unit.fk_uct = unit_category.uct_id and unit_category.uct_type in ("date", "duration", "weight") ORDER BY unt_name ASC;
I have this
and if I add a condition to the WHERE clause (uct_type = “true”) SELECT unt_name, unt_isDefault, uct_type FROM param_unit, unit_category WHERE param_unit.fk_uct = unit_category.uct_id and unit_category.uct_type in ("date", "duration", "weight") and unit_category.uct_type = "true" ORDER BY unt_name ASC;
Exist This Value “true” in This field (unit_category.uct_type ) ?
The logical operator “and” requires that all checks are true.
SELECT unt_name, unt_isDefault, uct_type FROM param_unit, unit_category WHERE param_unit.fk_uct = unit_category.uct_id and unit_category.uct_type in (“date”, “duration”, “weight”) and unit_category.uct_type = “true” ORDER BY unt_name ASC;
If only one of the expressions is false, the “and” will return false ( nothing will be returned).