0
以下查詢不會按升序爲0返回文檔結果。它直接從1個文件開始以升序排列,儘管有3個行有0個文件。文檔的順序不會返回正確的順序
SELECT UPPER(HostApplicationLocalData.ParentID)as ParentID, COUNT(Document.ID) as Documentsfrom HostApplicationLocalData inner join Documenton HostApplicationLocalData.ID=Document.HostApplicationLocalData_ID WHEREHostApplicationLocalData.TransactionType_ID = 6AND Document.Removed=0 ANDHostApplicationLocalData.Company_ID = 9000 AND (SharePointURI is not null or ((SharePointURI is nulland Content_ID is not null ) or((HostApplicationLocalData_ID is not null andHostApplicationLocalData_ID != 0 and Content_ID isnull)))) AND HostApplicationLocalData.ParentIDIN('ACETRAVE0001 ','ADVANCED0001 ','ALLENSON0001 ','AMERICAN0001 ','ASSOCIAT0001 ','ATTRACTI00001 ','AUSTRALIA ','AUTOFINA0001 ','BEAUMONT0001 ','BERGERON0001 ','BLOOMING0001 ','BURNETTT0001 ','BUSINESS MAG ','BUSINESS0001 ','CAPITALP0001 ','CARLSONS0001 ','CENTRALC0001 ','CHICAGOC0001 ','CHICAGOR0001 ','CIRCUITD0001 ','COMNETEN0001 ','COMPUTER0001 ','COMVEXIN0001 ','CONSUMER MAG ','CONTINEN0001 ','COWLEYEN0008 ','CRUGEREN0001 ','DISTANTI0001 ','DOLECKIC0001 ','ELECTRO0001 ','ELECTRON0001 ','ELECTRON0003 ','FABRIKAM0001 ','GARDNERS0001 ','GKCLEANI0001 ','GREENLAK0001 ','GREENWOO0001 ','GUNTHARS0004 ','HARVEYEL0001 ','HILLSBRO0001 ','ILSTATE0001 ','IMAGEMAK0001 ','INLANDRE0001 ','INLINESE0001 ','INNERCIT0001 ','INSTATET0001 ','INTEGRAT0001 ','INTERNAL0001 ','INTERNAT0001 ','INTERNAT0002 ','') group byHostApplicationLocalData.ParentID order by Documents asc