Re: Two table joins

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kumar S <ps_postgres(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Two table joins
Date: 2004-10-15 14:29:26
Message-ID: 8995.1097850566@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Kumar S <ps_postgres(at)yahoo(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2004-10-15 14:55:48 Re: copy error
Previous Message Joe Erickson 2004-10-15 12:31:21 Re: Getting Started