Two table joins - Mailing list pgsql-novice

From Kumar S
Subject Two table joins
Date
Msg-id 20041014151842.71195.qmail@web51402.mail.yahoo.com
Whole thread Raw
Responses Re: Two table joins  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: VIEWs with aggregate functions
Next
From: "Keith Worthington"
Date:
Subject: copy error