Re: [sqlite] How do i do this UPDATE in SQLite?

2006-10-15 Thread Mohd Radzi Ibrahim

Thanks, that works.

The syntax i used is allowed in MS SQL.

best regards,
Radzi.

- Original Message - 
From: "Kees Nuyt" <[EMAIL PROTECTED]>

To: 
Sent: Monday, October 16, 2006 1:54 PM
Subject: Re: [sqlite] How do i do this UPDATE in SQLite?



On Mon, 16 Oct 2006 09:53:19 +0800, you wrote:


update i set val=qty*q.price
from salesrecord i
inner join historicalprice q on i.itemid=q.itemid


I would use a correlated subquery which returns one column,
instead of the join. I don't think you can use aliasses there.

update salesrecord set val = qty * (select price from
historicalprice where historicalprice.itemid ==
salesrecord.itemid);  {untested}

It depends on the version if you can use this.


thanks.

Radzi.

--
 (  Kees Nuyt
 )
c[_]

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






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



Re: [sqlite] How do i do this UPDATE in SQLite?

2006-10-15 Thread Kees Nuyt
On Mon, 16 Oct 2006 09:53:19 +0800, you wrote:

>update i set val=qty*q.price
>from salesrecord i
>inner join historicalprice q on i.itemid=q.itemid

I would use a correlated subquery which returns one column,
instead of the join. I don't think you can use aliasses there.

update salesrecord set val = qty * (select price from
historicalprice where historicalprice.itemid ==
salesrecord.itemid);  {untested}

It depends on the version if you can use this.

>thanks.
>
>Radzi.
-- 
  (  Kees Nuyt
  )
c[_]

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



[sqlite] How do i do this UPDATE in SQLite?

2006-10-15 Thread Mohd Radzi Ibrahim
update i set val=qty*q.price
from salesrecord i
inner join historicalprice q on i.itemid=q.itemid


thanks.

Radzi.