Hi,
I have a table and need to return one reocrd. In my case, I have a strange requirement. If the resulting row's one columns is null, then should return second row's column alone in first row.
-----------------
|ID | Name|Group|
|----------------
| 1 | A | G1 |
| 2 | B | G2 |
| 3 | C | G3 |
-----------------
For example if row 1 Name(A) is null, it should return B but entire data should be from row 1 only.
select Name, Group from table1 where id = 1
results in A, G1
If Name of row 1(A) is null then result should be B, G1.
Can you help me on this please?
I have a table and need to return one reocrd. In my case, I have a strange requirement. If the resulting row's one columns is null, then should return second row's column alone in first row.
-----------------
|ID | Name|Group|
|----------------
| 1 | A | G1 |
| 2 | B | G2 |
| 3 | C | G3 |
-----------------
For example if row 1 Name(A) is null, it should return B but entire data should be from row 1 only.
select Name, Group from table1 where id = 1
results in A, G1
If Name of row 1(A) is null then result should be B, G1.
Can you help me on this please?