Reputation: 7133
I just accidentally noticed that a Query like
Update tableA tableA set id = '5'
Works fine. Should this give error as I am using table name twice here. Any thoughts why is this working fine ?
Upvotes: 3
Views: 44
Reputation: 29
your code exactly equal
Update tableA as 'tableA' set id = "5"
or
Update tableA as "tableA" set id = "5"
this is simple alias as Sql Alias Tutorial
Upvotes: 2
Reputation: 20499
Because the second tableA
is seen as an alias. There is no constraint in regards to the name of the alias, so you can have the same name on the alias as the table name.
Upvotes: 2