Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how many sets can be used in SQL UPDATE, syntax?

Status
Not open for further replies.

Dan01

Programmer
Jun 14, 2001
439
US
Using UPDATE, can one use more than one set variable in an UPDATE query:
UPDATE tblA SET Firstname='John' and LastName='Jones' WHERE Account='23425'. Thanks, Dan.
 
Thanks tlbroadbent. That's exactly what I needed. Dan.
 
How can I use SQL UPDATE query statement to update fields in multiple tables joined by foreign keys.

How can I use joins in SQL UPDATE query statement.

Please help me, I'm very thankful in advance
 
You cant update more than one table in one update statement.

Examples on join:

update orders
set price=23
where orderdate in (
select indate
from currentorders);

update orders o
set price=76
where exists (
select *
from currentorders c
where o.orderno = c.orderno)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top