hql query to fetch data and sum of amount
问题 I am writing query to fetch data from tables my hql query is SELECT distinct bd FROM BillDetails AS bd LEFT JOIN FETCH bd.customerDetails AS cd LEFT JOIN FETCH bd.billProductList AS bpd LEFT JOIN FETCH bpd.product AS pd WHERE bd.billNo=:id AND bd.client.id=:cid Above query is working properly I want to write query to fetch sum of all amount field of billPaidDetailses . billPaidDetailses is a list in BillDetails class. I am trying following query for that but it is not working String hql =