I am assuming each field and its possible list of value are checkboxes in image. If it is the case, then each search field can become part of where clause with value. For example, WHERE 1=1 AND marital_status = 'Single' AND is_driniking in ('Yes','Occasionally') Please let me know if my understanding is incorrect.