I wrote the below query to create 2 new columns and then add the data data from column Level_code before the first "-" into column BU and after the "-" into column Site_name. The issue is that in azure data studio there is no Substring_index function. Is there an alternative to this that does the same feature?
--Add two new columns to hold the split values
ALTER TABLE Table_Name
ADD "BU" VARCHAR(255),
ADD "Site_Name" VARCHAR(255);
--Update the new columns with the split values
UPDATE your_table_name
SET BU = SUBSTRING_INDEX(Level_code, '-',1), --Get the part before the first "-"
Site_Name = SUBSTRING_INDEX(Level_code, '-',-1); --Get the part after the first "-"