select cast(Startpos as integer) from Message_Rule Where Texttype='612'
Union
Select Startpos+(select max(cast(Endpos as Integer)) from Message_Rule where texttype='612') From Message_Rule Where Texttype='613'
Union
Select Startpos+(select max(cast(Endpos as Integer)) from Message_Rule where texttype='612') From Message_Rule Where Texttype='613'