这也会返回我想要的内容,但是在vba中,它会出现语法错误(选择....',')'部分。关于我在vba中做错什么的任何建议?
sSQLSting = "SELECT related_id, New_Cat, (Select distinct concat(Final_LOB, ',') from Data$ b " _
& "where b.RELATED_ID = a.RELATED_ID for xml path ('') ), sum(Inflated_Amount), " _
& "sum(inflated_amount)/count(final_lob), related_root_cause, related_description FROM data$ a " _
& "WHERE [Final_LOB] IN (" & add & ") AND [Inflated_Amount] > 0 " _
& "GROUP BY related_id, [New_Cat], [RELATED_ROOT_CAUSE], [RELATED_DESCRIPTION] HAVING COUNT([FINAL_LOB]) > 1 " _
& "ORDER BY sum([Inflated_Amount])/COUNT([Final_LOB]) DESC;"