doe
doe

Reputation: 148

how to add a inner join clause in a update statement

when i run the following query with an inner join it gives me the following error

"ORA-00933: SQL command not properly ended" in my from clause.Am i not positioning it in the correct format?

update
             Table t

    set
         t.gross =4000
 FROM Schema1.Table  t INNER JOIN schema2.TYPES AS gt ON t.GRADE=gt.DESCRIPTION
    where
       GT.GRADE_TYPE_CODE='test'

Upvotes: 0

Views: 1936

Answers (2)

XING
XING

Reputation: 9886

Try this:

UPDATE         TABLE t
    set          t.gross =4000
  where  t.GRADE in (   select gt.DESCRIPTION from  schema2.TYPES gt where
       GT.GRADE_TYPE_CODE='test')

Upvotes: 1

Bhasin
Bhasin

Reputation: 23

I think what you are asking is already on stackoverflow.

This can help you:

https://stackoverflow.com/a/2446834/6517368

Upvotes: 1

Related Questions