Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

SQL Update Question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL Update Question

    Hi. Need some help......... Thanks in advance I am using Query Manager Query in SQL prompt but I can use regular SQL – it does not matter. I cannot figure out syntax to Update 2 field from file A with values from file B. I tried multiple variations and none of it worked. Below is what I came with – it's STILL DOES NOT work – Please Help. Thank you. Gary ------------------------------- Update GSEGAL/SALESFL A -- Set Fields Set A.SHPST = ( Select B.STATE FROM SHIPFL B), A.SHPZIP= ( Select B.CZIP FROM SHIPFL B) -- Selections Where SHPST = ' ' And A.SHIP# <> ' ' And A.DIV = B.DIV And A.CUST# = B.CUST# ---------------------------------------------

  • #2
    SQL Update Question

    The portions of your where clause that deal with file "B" will have to be within both subselects. Additionally, SQL will only want 1 possible row to be returned by both subselects. You can use the min or max function to do this. You can decide for yourself, but if it were me I'd figure out some other way to do it.

    Comment

    Working...
    X