Re: [sqlite] Re: update table based on results from a query involving a join?

2005-12-13 Thread Joe Wilson
Yes, that did the trick. Thanks. --- Igor Tandetnik <[EMAIL PROTECTED]> wrote: > UPDATE accomodation > SET country = ( > SELECT c.country > FROM country c > WHERE c.country_id = accomodation.country_id > ); > > Igor Tandetnik > > __ Do

[sqlite] Re: update table based on results from a query involving a join?

2005-12-12 Thread Igor Tandetnik
Joe Wilson wrote: It results in a error - it stops parsing the statement at the alias 'a'. It seems simple, but I don't believe it is possible to do this in SQLite. I've tried a dozen common syntax variants used by other databases without success. Try UPDATE accomodation SET country = ( SELE

Re: [sqlite] Re: update table based on results from a query involving a join?

2005-12-12 Thread Joe Wilson
It results in a error - it stops parsing the statement at the alias 'a'. It seems simple, but I don't believe it is possible to do this in SQLite. I've tried a dozen common syntax variants used by other databases without success. Here is the syntax of the SQLite UPDATE statement: sql-statement

[sqlite] Re: update table based on results from a query involving a join?

2005-12-12 Thread Igor Tandetnik
Joe Wilson wrote: Does anyone know how I might accomplish this in SQLite using a single update statement? -- MySQL UPDATE accomodation a, country c SET a.country = c.country WHERE a.country_id = c.country_id; -- Oracle UPDATE accomodation a SET a.country = ( SELECT c.country FROM country c