sql統(tǒng)計某列值的總個數(shù) 如何在Visual C 中用ADO,對SQL數(shù)據(jù)庫某一列中相同的數(shù)據(jù)進行個數(shù)統(tǒng)計?
如何在Visual C 中用ADO,對SQL數(shù)據(jù)庫某一列中相同的數(shù)據(jù)進行個數(shù)統(tǒng)計?首先定義記錄集RecordsetPtrmPrcordset然后從Conn獲取記錄集。請注意,您需要將asnum添加到
如何在Visual C 中用ADO,對SQL數(shù)據(jù)庫某一列中相同的數(shù)據(jù)進行個數(shù)統(tǒng)計?
首先定義記錄集RecordsetPtrmPrcordset然后從Conn獲取記錄集。請注意,您需要將asnum添加到SQL中,這意味著count(*)作為變量num輸出VSQL=“selectcount(*)作為numfromtable,其中column=”“str”“”Muprecordset=MuADOConn.GetRecordSet文件(VSQL)然后ubstr utnum=(ubstr ut)m Prcordset->getcollect((long)0)num是您想要的數(shù)字。