On Tue, May 18, 2010 at 6:08 AM, Rich Shepard <[email protected]> wrote:
> On Tue, 18 May 2010, Armaghan Saqib wrote:
>
>> these transactions are from acc_trans table and can be looked up as:
>>
>> SELECT * FROM acc_trans WHERE trans_id IN (id1, id2, id3 ... etc.)
>>
>> and can be deleted as:
>>
>> DELETE FROM acc_trans WHERE trans_id IN (id1, id2, id3 ... etc.)
>
> Armaghan,
>
> That's what I thought, and what I tried. For some reason psql told me
> there was an error (not specified, of course) by the SELECT key word. I'll
> try again.
Hi Rich,
Perhaps SELECT-ing and DELETE-ing individual transaction-IDs at a time
would work better? Here is a transcript of what I'm suggesting,
without the DELETE, of course:
# su - postgres
$ psql wrconsulting
Welcome to psql 7.4.11, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
wrconsulting=# select * from acc_trans where trans_id=10171;
trans_id | chart_id | amount | transdate | source | cleared |
fx_transaction | project_id
----------+----------+--------+------------+-----------+---------+----------------+------------
10171 | 10053 | -17.5 | 2003-08-18 | 20030818d | f | f
|
10171 | 10002 | 17.5 | 2003-08-18 | 20030818d | t | f
|
(2 rows)
wrconsulting=# \q
$ logout
#
--
Best Regards,
Wallace
_______________________________________________
SQL-Ledger mailing list
[email protected]
http://lists.ledger123.com/mailman/listinfo/sql-ledger