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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update with select

Status
Not open for further replies.
Jan 20, 2005
180
US
Cant get the syntax quite right

update joblist set subdate = select sdate from invoice where job=10

 
UPDATE joblist
SET subdate = (SELECT sdate FROM invoice WHERE job=10)
WHERE some condition(s) on joblist's fields

I guess this should work:
UPDATE joblist INNER JOIN invoice ON joblist.job = invoice.job
SET joblist.subdate = invoice.sdate
WHERE joblist.job = 10

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Oh one of great stupidity *points at self*
Add ()'s and things work nicely...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top