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

How To Update Field in One Table Based on Value in Another Table

Status
Not open for further replies.

byrne1

Programmer
Aug 7, 2001
415
US
Here's the SQL code that I have so far that does not work:

UPDATE ITEM SET webflag='' where itemnum=(select itemnum from itmdescr where description1='')

Basically, I want to set the webflag field to <blank> for any items whose description1 field is blank.

Any suggestions? TIA!!
 
You may try this:
UPDATE ITEM INNER JOIN itmdescr ON ITEM.itemnum=itmdescr.itemnum
SET webflag=''
WHERE description1=''

Or this:
UPDATE ITEM SET webflag='' where itemnum In (select itemnum from itmdescr where description1='')

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top