SELECT COUNT(*) FROM 表 WHERE LEN(ALLTRIM(STR(XXDM)))<=4
SELECT COUNT(*) FROM 表 WHERE LEN(ALLTRIM(XXDM))=4