Insert into and case statement using SQL server part -10

preview_player
Показать описание
-insert into copy data one table to another table.
-The CASE statement goes through conditions and returns a value when the first condition is met (like an IF-THEN-ELSE statement). So, once a condition is true, it will stop reading and return the result. If no conditions are true, it returns the value in the ELSE clause.
--If there is no ELSE part and no conditions are true, it returns NULL
You can use the CASE expression to insert data into a SQL Server table. The INSERT statement with CASE will scan for the required values and if found, insert values from THEN expression.
Рекомендации по теме