Есть таблица, которая выводится вот таким select'ом
SELECT j.rid, to_char(j.request_date, 'DD-MM-YYYY') AS request_date, request_type.type, request_object.obj_name,
j.request_org, j.request_person, j.request_phone, j.request_point, request_state.state_name, j.request_comment, j.request_executive
FROM {journal_of_requests} AS j
JOIN request_type ON request_type_id = rtid
JOIN request_object ON request_object_id = oid
JOIN request_state ON request_state_id = sid
ORDER BY j.rid
j.request_org, j.request_person, j.request_phone, j.request_point, request_state.state_name, j.request_comment, j.request_executive
FROM {journal_of_requests} AS j
JOIN request_type ON request_type_id = rtid
JOIN request_object ON request_object_id = oid
JOIN request_state ON request_state_id = sid
ORDER BY j.rid
Мне нужно дать пользователю возможность фильтровать по полям request_type.type, request_object.obj_name и request_state.state_name.
Как это лучше сделать?