I have a table that stores information about vendors. In it, there about 10 boolean columns that indicate what departments the vendor belongs to. The vendor can belong to more than one department.
How do I query the table to find any vendors that have more than one of the boolean columns marked true?
My tbl_vendor_departments Columns:
vendor_id (varchar) vendor_name (varchar) clothing(bool) automotive(bool) lawn_garden(bool) tools(bool)… and so on.
I think booleans are actually treated as tiny ints (0 or 1). In that case, you can add up all boolean fields and check if the result > 1.