Sql table data conversion from decimal to binary with multiple records

25 Views Asked by At

Sql table data conversion from decimal to binary with multiple records

table details

PK_No   Model1  Model2
PK-01     3       4
PK-02     5       6

Need output

PK_No   Model1  Model2
PK-01     1       0
PK-01     1       0   
PK-01     0       0
PK-01     0       1
PK-02     0       0
PK-02     1       0
PK-02     0       1
PK-02     1       1

I HAVE USED CROSS APPLY and also tried through Substring and split. but its becoming heavy to handle.

I just need to convert 100 rows of decimal data into 400 rows of binary data

0

There are 0 best solutions below