It would be beneficial if you would post some CREATE object statements and sample data in order for us to give you a quick and accurate solution.
Anyway, here is a quick suggestion which you might want to adapt to suit your query needs :
Assuming we have a table with the following columns ss, tp, yh and fg, you can do something like this,
set ss = case when left(ASP_Tin, 2) = 'ss' then ASP end,
set tp = case when left(ASP_Tin, 2) = 'tp' then ASP end,
set yh = case when left(ASP_Tin, 2) = 'yh' then ASP end,
set fg = case when left(ASP_Tin, 2) = 'fg' then ASP end
Actually i havent create anything yet coz i'm so sure how to do it.
Well, i'm actually have this table already which has this field that these datas and they are all mix up. My duty is to write sql statement in stored procedure to separate all the datas out into designated field which are not created in a table or sumting like that.it just can be shown out in the Sql Query Analyser and not to update any table or create a new one.
The source of table is as follow: