Two table joins

From: Kumar S <ps_postgres(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Two table joins
Date: 2004-10-14 15:18:42
Message-ID: 20041014151842.71195.qmail@web51402.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi all,

I have 3 tables like the following:

sample_table:
samp_id
samp_desc
samp_data

Experiment table:
exp_id
samp_id
exp_slot_id
exp_data1
exp_data2

exp_slot_table
exp_slot_id
exp_id
exp_slot_name

Now I want to update column samp_id in experiment
table.

I want to introduce samp_id = 3 and with a clause :
update samp_id in experiment table WHERE exp_slot_name
= 3264.dat; Here 3264.dat has exp_slot_id which is
present as a column in experiment table.

Can any one help me to get a correct update statement.
I am confused here.

My wrong SQL statement:

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

Thank you.
Kumar



__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Keith Worthington 2004-10-14 18:12:49 copy error
Previous Message Tom Lane 2004-10-14 04:09:16 Re: VIEWs with aggregate functions