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

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 (view raw or flat)
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

pgsql-novice by date

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

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