ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Update Statement with INNER JOin

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

  • Update Statement with INNER JOin

    HI

    Can any one know the SQl statement, UPDATE with inner join...

    I want to update a field in File1 by comparing the values from the file2

    Like
    Update File1 Inner Join File2 On File2.SNo = File1.sno
    SET File1.date = 20120523 WHERE (((File1.Date >20120523))

    but its not allowing ....
    Can anyone give correct statement
    Thanks
    Venkat

  • #2
    Re: Update Statement with INNER JOin

    Code:
    /Free
    
      Exec Sql
      UPDATE LIBRARY/TABLE1 a SET FIELD1 = 'New Value'
      WHERE exists (Select * From LIBRARY/Table2 b where a.ID = b.ID)
    
    /End-Free
    Sample from Alam Fernandez posted at 2012-02-08 06:20:42

    Comment

    Working...
    X