Re: Two table joins - Mailing list pgsql-novice

From Tom Lane
Subject Re: Two table joins
Date
Msg-id 8995.1097850566@sss.pgh.pa.us
Whole thread Raw
In response to Two table joins  (Kumar S <ps_postgres@yahoo.com>)
List pgsql-novice
Kumar S <ps_postgres@yahoo.com> writes:
> My wrong SQL statement:

> update experiment SET samp_id =3 WHERE (select
> exp_slot_name = 4264.dat WHERE exp_slot_id =
> exp_slot_name);

I think you want something like

update experiment SET samp_id = 3
WHERE exp_slot_id = (SELECT exp_slot_id FROM exp_slot_table
                     WHERE exp_slot_name = '4264.dat');

            regards, tom lane

pgsql-novice by date:

Previous
From: "Joe Erickson"
Date:
Subject: Re: Getting Started
Next
From: Tom Lane
Date:
Subject: Re: copy error