sqloracle-databaseora-00933

SQL Update Using From


I know this is a contrived example so please do not jump all over me for the uselessness of the code. This is an issue in more complex chunk of code but I wanted to isolate the I am having.

The error I am getting is 'SQL Error: ORA-00933: SQL command not properly ended'. Any ideas? I am using SQL Developer by the way.

Once again...this is a contrived example and while the join is pointless in this case it is not in the more complex example.

Here is the code:

Update u
set first300pa = 1
from GameData_ME u
inner join 
GameData_ME v on u.pitchandeventid = v.pitchandeventid

Solution

  • As this blog says,

    Those who transitioned from SqlServer to Oracle might find the absence of the UPDATE FROM a significant loss.

    Fortunately, the blog continues by showing a lot of the power of Oracle's UPDATE and how to use it to perform the tasks you need (but it won't be with a FROM clause in the UPDATE statement... not in Oracle!-).