Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

pgsql-novice by date

Next:From: Tom LaneDate: 2004-10-15 14:55:48
Subject: Re: copy error
Previous:From: Joe EricksonDate: 2004-10-15 12:31:21
Subject: Re: Getting Started

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group