When the subquery fails to find a matching row in tbl B, the subquery returns NULL.But since the UPDATE has no WHERE clause, it will update all rows, even those where the subquery returns NULL.But, at the same time they were going to be under management of manager id # 205.
As we’ve already created both the tables in above example, we will directly write a trigger for ‘AFTER UPDATE’.
statement can be accomplished in one of two ways, primarily depending upon which version of SQL Server you are using.
We’ll briefly explore both options so you can find what works best for you.
Actually, if you mess up on the WHERE line in the last query, you will end up getting the following error message: “ TJ Abrahamsen is the founder and author of Oracle Coder. His expertise is with Oracle SQL, PL/SQL, and the latest years Java against Oracle databases.
He loves teaching others, and like to share his thoughts, ideas, and experience on his blog.