Dim str = new string() {"AEI;AEV;AEV.1", "", "ACA","ETT.0;ETU.0","HW2;IND.523;IND.527;IND.528;IND.529;IND.577;IND.580;IND.605;LC1;XME"}
console.WriteLine("-- " & s & Environment.NewLine & GetSQL(s) & Environment.NewLine)
Private function GetSQL(str as string) as string
dim ss = str.Split(new string() {";"}, StringSplitOptions.None).Select(function(s) "select '" & if(s.contains("."), s.split(".")(0) & "' as custcode, '" & s.Split(".")(1) & "' as custser", s & "' as custode, '0' as custser"))
return ";with custs as (" & string.Join(Environment.NewLine & " union all ", ss) & ")"