当 RECORD_TYPE='ERROR' 时,如何通过 Record_No 获取每个 location_Name 的唯一记录数。如果对于 RECORD_NO 有 RECORD_TYPE='ERROR' 的多条记录,则 RECORD_NO 只应计算一条记录,最后所有这些记录应按 LOCATION_NAME 分组,下面是 xml 日期
<root>
<SellOutErrorRecord>
<RECORD_TYPE>WARNING</RECORD_TYPE>
<RECORD_NO>1</RECORD_NO>
<ERROR_DESC>trx doc type is invalid</ERROR_DESC>
<LOCATION_NAME>Chen Ken</LOCATION_NAME>
<PRODUCT_NUMBER>336549R-001</PRODUCT_NUMBER>
</SellOutErrorRecord>
<SellOutErrorRecord>
<RECORD_TYPE>ERROR</RECORD_TYPE>
<RECORD_NO>2</RECORD_NO>
<ERROR_DESC>invoice amount is zero</ERROR_DESC>
<LOCATION_NAME>Chen Ken</LOCATION_NAME>
<PRODUCT_NUMBER>3X-KN73C-DB</PRODUCT_NUMBER>
</SellOutErrorRecord>
<SellOutErrorRecord>
<RECORD_TYPE>ERROR</RECORD_TYPE>
<ERROR_DESC>sales qty is zero</ERROR_DESC>
<RECORD_NO>2</RECORD_NO>
<LOCATION_NAMEChen Ken</LOCATION_NAME>
<PRODUCT_NUMBER>3X-KN73C-DB</PRODUCT_NUMBER>
</SellOutErrorRecord>
<SellOutErrorRecord>
<RECORD_TYPE>ERROR</RECORD_TYPE>
<ERROR_DESC>trx currency is invalid</ERROR_DESC>
<RECORD_NO>3</RECORD_NO>
<LOCATION_NAME>Chen Ken</LOCATION_NAME>
<PRODUCT_NUMBER>339112-B25</PRODUCT_NUMBER>
</SellOutErrorRecord>
<SellOutErrorRecord>
<RECORD_TYPE>ERROR</RECORD_TYPE>
<ERROR_DESC>invoiced net amount is invalid</ERROR_DESC>
<RECORD_NO>3</RECORD_NO>
<LOCATION_NAME>Chen Ken</LOCATION_NAME>
<PRODUCT_NUMBER>445860-B21</PRODUCT_NUMBER>
</SellOutErrorRecord>
<SellOutErrorRecord>
<RECORD_TYPE>ERROR</RECORD_TYPE>
<ERROR_DESC>invoiced net amount is invalid</ERROR_DESC>
<RECORD_NO>1</RECORD_NO>
<LOCATION_NAME>Chen Ken</LOCATION_NAME>
<PRODUCT_NUMBER>339112-B25</PRODUCT_NUMBER>
</SellOutErrorRecord>
<SellOutErrorRecord>
<RECORD_TYPE>WARNING</RECORD_TYPE>
<RECORD_NO>1</RECORD_NO>
<ERROR_DESC>trx doc type is invalid</ERROR_DESC>
<LOCATION_NAME>Cheng Boon</LOCATION_NAME>
<PRODUCT_NUMBER>336549R-001</PRODUCT_NUMBER>
</SellOutErrorRecord>
<SellOutErrorRecord>
<RECORD_TYPE>ERROR</RECORD_TYPE>
<RECORD_NO>2</RECORD_NO>
<ERROR_DESC>invoice amount is zero</ERROR_DESC>
<LOCATION_NAME>Cheng Boon</LOCATION_NAME>
<PRODUCT_NUMBER>3X-KN73C-DB</PRODUCT_NUMBER>
</SellOutErrorRecord>
<SellOutErrorRecord>*-
<RECORD_TYPE>ERROR</RECORD_TYPE>
<ERROR_DESC>sales qty is zero</ERROR_DESC>
<RECORD_NO>2</RECORD_NO>
<LOCATION_NAME>Cheng Boon</LOCATION_NAME>
<PRODUCT_NUMBER>3X-KN73C-DB</PRODUCT_NUMBER>
</SellOutErrorRecord>
<SellOutErrorRecord>
<RECORD_TYPE>ERROR</RECORD_TYPE>
<ERROR_DESC>trx currency is invalid</ERROR_DESC>
<RECORD_NO>3</RECORD_NO>
<LOCATION_NAME>Cheng Boon</LOCATION_NAME>
<PRODUCT_NUMBER>339112-B25</PRODUCT_NUMBER>
</SellOutErrorRecord>
<SellOutErrorRecord>
<RECORD_TYPE>ERROR</RECORD_TYPE>
<ERROR_DESC>invoiced net amount is invalid</ERROR_DESC>
<RECORD_NO>3</RECORD_NO>
<LOCATION_NAME>Cheng Boon</LOCATION_NAME>
<PRODUCT_NUMBER>445860-B21</PRODUCT_NUMBER>
</SellOutErrorRecord>
</root>
预期的输出是:
LOCATION_NAME:Chen Ken COUNT:3
LOCATION_NAME:Cheng Boon COUNT:2