select iRecord,ord,count(DISTINCT iRecord) from(select top 1000 iRecord,0 as ord from tblBoardRecord_1800000121_23 Where idCorp=1800000121 and iProject=23 and (field12 like '%中华人民共和国海关进出口货物报关单填制规范^74750%') UNION select top 1000 iRecord,1 as ord from tblBoardRecord_1800000121_23 Where idCorp=1800000121 and iProject=23 and (field2 like '%中华人民共和国海关进出口货物报关单填制规范^74750%')) a where irecord<>0 group by iRecord,ord order by ord asc,iRecord desc
йͶָ