I have a table that looks like below, with possible nulls in initial columns. I am looking to shift the columns to left in case a null is found so that all the categories align together.
Below are the DDL statements:
CREATE TABLE CATEGORIES
(L1 varchar(255),
L2 varchar(255),
L3 varchar(255),
L4 varchar(255)
);
Insert records:
INSERT INTO CATEGORIES
(L1, L2, L3, l4)
VALUES
('Womens Clothing' , 'Womens Accessories', 'View all Accessories', null );
INSERT INTO CATEGORIES
(L1, L2, L3, l4)
VALUES
(null , 'Womens Clothing', 'Womens Accessories', 'Bags');
INSERT INTO CATEGORIES
(L1, L2, L3, l4)
VALUES
(null , null, 'Mens Clothing', 'Shirts' );
I am quite new to SQL and quite not able to wrap my head around how to solve this