The Id piece works great thanks! If I want to update 2 fields on table
A, the following syntax doesn't work as expected, as it updates all to
records to 'DONE'.
 
update A set Flag = 'DONE',
Id = coalesce(
    (select Id from B
     where A.Field1 = B.Field_Temp and B.Price > 0),
    Id);

-----Original Message-----
From: Andre du Plessis 
Sent: 16 July 2007 02:30 PM
To: Gavin McGuinness
Subject: FW: [sqlite] Re: inner join

Here you go
It was answered by the mighty Igor, he's like THEE guru, guru's turn to
him for help, so don't question just follow :)

-----Original Message-----
From: Igor Tandetnik [mailto:[EMAIL PROTECTED] 
Sent: 16 July 2007 01:49 PM
To: SQLite
Subject: [sqlite] Re: inner join

Andre du Plessis <[EMAIL PROTECTED]> wrote:
> I would like to be able to accomplish the following but don't see any
> support for inner joins on update queries.
> 
> update A
> set Id = B.Id
> from A inner join B
> on A.Field1 = B.Field_Temp
> where B.Price > 0

update A set Id = coalesce(
    (select Id from B
     where A.Field1 = B.Field_Temp and B.Price > 0),
    Id);

Igor Tandetnik

------------------------------------------------------------------------
-----
To unsubscribe, send email to [EMAIL PROTECTED]
------------------------------------------------------------------------
-----


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to