Home » SQL & PL/SQL » SQL & PL/SQL » Update Query Help require
Update Query Help require [message #410745] Tue, 30 June 2009 01:30 Go to next message
samit_gandhi
Messages: 226
Registered: July 2005
Location: Hong Kong
Senior Member

Hi

I want to update two column rate_usd, rate_local of the sales_detail table. how to get the query for it. My sql query is like this :

select b.rate_usd, b.rate_local
from sales_detail b, sales_master c, ref_master d
where b.sr_no=c.sr_no
and b.company_id=c.company_id
and c.company_id=21
and c.customer_id=11
and c.annexure_code=1200
and d.ref_code=b.ref_code
and d.company_id=b.company_id
and d.group_code=19
and b.company_id=21

Regards

Samit Gandhi
Re: Update Query Help require [message #410754 is a reply to message #410745] Tue, 30 June 2009 02:15 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Obviously, you'll need the UPDATE statement to do that:
UPDATE sales_detail SET
  rate_usd = its_new_value,
  rate_local = its_new_value
WHERE certain_conditions_are_met

I didn't quite get the way "its_new_value" is to be found; you've posted the SELECT statement, but ... what do you want to do with it? Does it fetch these columns' new values?

Also, all ways of use of the UPDATE statement can be found in the documentation.
Previous Topic: Need to take different column & row values into a single row (merged)
Next Topic: query tuning
Goto Forum:
  


Current Time: Tue Feb 11 09:58:23 CST 2025