Snowflake Vs MS-SQL - Part 28 - CONCAT
CONCAT
Suppose you have a table and it is storing department ID as below.
+-------------+------------+------------+---------------+
| EMPLOYEE_ID | LAST_NAME | FIRST_NAME | DEPARTMENT_ID | |-------------+------------+------------+---------------| | 101 | Montgomery | Pat | 1 | | 102 | Levine | Terry | 2 | | 103 | Comstock | Dana | 2 | +-------------+------------+------------+---------------+
As per requirement, you want to display the department ID as Dept-1.
+-------------+------------+------------+---------------+
| EMPLOYEE_ID | LAST_NAME | FIRST_NAME | DEPARTMENT_ID | |-------------+------------+------------+---------------| | 101 | Montgomery | Pat | DEPT-1 | | 102 | Levine | Terry | DEPT-2 | | 103 | Comstock | Dana | DEPT-2 | +-------------+------------+------------+---------------+
MS-SQL Server
Comments
Post a Comment