smashclash
Board Regular
- Joined
- Nov 24, 2003
- Messages
- 126
- Office Version
- 365
- Platform
- Windows
I have a table with two columns. One is PID which is various whole numbers and the other is QTY (Quantity). I'm trying to write an SQL statement that will list the average quantity whenever PID = 2.
Right now I have
SELECT Pid, AVG(qty)
FROM Line_item
Where Pid = '2';
But I keep getting the error - tried to execute a query that does not include the specified expression 'pid' as part of the aggregate function. Anyone have any ideas? TIA.
Right now I have
SELECT Pid, AVG(qty)
FROM Line_item
Where Pid = '2';
But I keep getting the error - tried to execute a query that does not include the specified expression 'pid' as part of the aggregate function. Anyone have any ideas? TIA.