I am trying to create an SQL query to divide into 2 separate columns based on a rule. My table is as follows
Name | Item ID | Parent ID
----- | -------- | ----------
A | 1 | Null
B | 2 | Null
C | 3 | Null
D | 4 | Null
A1 | 5 | 1
A2 | 6 | 1
A3 | 7 | 1
B1 | 8 | 2
B2 | 9 | 2
B3 | 10 | 2
Is it possible to have the values in the [Name] column be divided into 2 columns?
e.g. if the value of the [Parent ID] is Null, the value in [Name] column be in column 1 and if the value of [Parent ID] is 1, it would be placed in column 2?
Please advice and thanks in advance!