I have table named purchase
. It has columns billno, billdate, qty, amount
. When I run group by
query, it is throwing an error.
Query I used
SELECT
BILLNO,
BILLDATE,
SUM(QTY) AS SUMQTY,
SUM(AMOUNT) AS SUMAMOUNT
FROM
PURCHASE
GROUP BY
BILLNO
This is the error I'm getting - how to get bill wise total amount?
Column 'PURCHASE.BILLDATE' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.