Re: PG Version 8.1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/22/05, Diego <diego@xxxxxxxxxxxxxxxxx> wrote:
> Hi, i use pg version 8.0 and i have this case:
>
> UPDATE tbpeople
> SET dt_update = '11/22/2005'
> WHERE tbdoctor.id_people = tbpeople.id
>
> But now, in version 8.1, this instrution give me an error:
> [ERROR:  missing FROM-clause entry for table "tbdoctor"]
>
> Who can i do now to get the same result?

Try:

UPDATE tbpeople
SET dt_update = '11/22/2005'
FROM tbdoctor
WHERE tbdoctor.id_people = tbpeople.id

or:

UPDATE tbpeople
SET dt_update = '11/22/2005'
WHERE id IN (SELECT id_people FROM tbdoctor)

Note that the FROM clause in UPDATE is a PG extension.

  John

> Thanks...
> Diego Ziquinatti


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux