txrx-ltd=# select * from acc_trans where trans_id not in (select id from ap) and chart_id = (select id from chart where accno = 5004); trans_id | chart_id | amount | transdate | source | cleared | fx_transaction | project_id | memo | invoice_id | entry_id ----------+----------+--------+------------+--------+---------+----------------+------------+------+------------+---------- 10275 | 10207 | -24.67 | 2007-07-01 | | f | f | | | 33 | 101 10275 | 10207 | -24.67 | 2007-07-01 | | f | f | | | 34 | 104 10281 | 10207 | -24.67 | 2007-07-01 | | f | f | | | 35 | 113