Need a query

India
September 9, 2009 9:53am CST
I have a table called Store with 4 columns ItemCode, Date, Qty, In_Out. Now I need the query to get the list of ItemCode that transacted on particular day where sum of Qty below 2000. Is it possible to get this in a single query?
2 responses
• Australia
17 Sep 09
You will need to use a GROUP BY and a HAVING clause in your query: SELECT ItemCode FROM Store WHERE Date = TO_DATE(date_specified, date_format) GROUP BY ItemCode HAVING SUM(Qty)
@repzkoopz (1895)
• Philippines
10 Sep 09
are you referring to SQL query? i'm not sure if i remember it right but i think this would do the trick.. please do correct me if i'm wrong.. SELECT ItemCode FROM Store WHERE Date = TO_DATE(date_specified, date_format) AND SUM(Qty)