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 ?
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With