joebloggs2004
New member
- Local time
- Tomorrow, 02:52
- Joined
- Oct 26, 2004
- Messages
- 6
I have some SQL query problems, which I can't figure out exactly where the problem is.
I think its some problem with the ( ) part on the SELECT line, but what exactly I have no idea.
I keep getting this message: "You tried to execute a query that does not include the specified expression 'description' as part of an aggregate function." but I don't understand what it means. Can anyone explain what it means and how/where to fix the problem? I think the problem is with GROUP BY, but I'm unsure.
And this problem:
List supervisors (staffid, surname and first name) and all of their subordinates (staffid, surname and first name).
I can't figure out how to get it to display the supervisors then the subordinates of that supervisor. It doesn't make a lot of sense. The supervisors have a supervisor attribute equalling null (or nothing).
PHP:
SELECT RL.productNum, RL.qtyRequested, PL.quantityPicked, (RLqtyRequested – PL.quantityPicked)
FROM REQUEST_LIST AS RL, PICKING_LIST AS PL
WHERE RL.productNum = (SELECT productNum FROM PICKING_LIST);
PHP:
SELECT PL.productNum, P.description, SUM(PL.quantity)
FROM PRODUCT AS P, PROD_LOCATION AS PL
WHERE P.productNum = PL.productNum
GROUP BY PL.productNum;
And this problem:
List supervisors (staffid, surname and first name) and all of their subordinates (staffid, surname and first name).
I can't figure out how to get it to display the supervisors then the subordinates of that supervisor. It doesn't make a lot of sense. The supervisors have a supervisor attribute equalling null (or nothing).