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
WHERE
j.request_object_id IN (SELECT rop.oid FROM request_object_perm AS rop WHERE rop.uid='4')
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
WHERE
j.request_object_id IN (SELECT rop.oid FROM request_object_perm AS rop WHERE rop.uid='4')
ORDER BY j.rid
Вложение | Размер |
---|---|
psql.jpg | 22 КБ |
Комментарии
INNER JOIN table1 ...
INNER JOIN table2 ...
INNER JOIN table3 ...