Nightfox79 <[email protected]>
wrote:
> I'm trying to update one table based on information in an other. I
> have two tables, transactions (trans) and accounts (account). I want
> to update the debit amount in the transaction table (trans) with vat
> information from the accounts table (account) for a particular
> account. Normally (ie. in other DBMS) it's no problem - the syntax is;
>
> UPDATE t
> SET t.debit = trans_debit/a.acc_vat
> FROM trans t,account a
> WHERE a.acc_id=t.acc_id
>
> --ERROR : near ".": syntax error
>
> Why do I get this error? Does SQLite not support joined update
> statements?
No it doesn't. Make it
UPDATE trans
SET debit = trans_debit / (
SELECT a.acc_vat FROM account a
WHERE a.acc_id = trans.acc_id
);
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users