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

problem updating table based on results from another table 1

Status
Not open for further replies.

elpico

Programmer
May 14, 2003
19
0
0
GB
I'm struggling with this piece of sql - Basically I want to update a column called output in table A (fileid, output) based on what is set to true on a similar column in Table b.(fileid, outname, sitename)

I've tried to do it with joins but no luck - any ideas on where I should be going with this?

UPDATE tableA A INNER JOIN tableB B ON A.FileId = B.FileID
SET A.[Output] = True
where (A.FileId = B.FileId) and (B.SiteName = 'PP') and (B.[output] = True);

Thanks,
e.
 
elpico, change your

where (A.FileId = B.FileId) and (B.SiteName = 'PP') and (B.[output] = True);

to

where ((B.SiteName = 'PP') and (B.[output] = True));
 
Nice one - works a treat - was silly of me to try and build a relationship when I already have it in the JOIN!

Thanks,
e.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top