use saidao_main SELECT COUNT(1) from TAppSession WHERE FSystemInfo != '' SELECT SUBSTRING(FSystemInfo, CHARINDEX('"SDKVersion":"',FSystemInfo) ,20) from TAppSession WHERE FSystemInfo != '' ORDER BY SUBSTRING(FSystemInfo, CHARINDEX('"SDKVersion":"',FSystemInfo) ,20)