Running into Error Code 1111 on MySQL how can I fix it?

167 Views Asked by At

SELECT * FROM PRODUCT WHERE P_CODE = (SELECT P_CODE FROM LINE WHERE LINE_TOTAL > AVG(LINE_TOTAL));

1

There are 1 best solutions below

0
On BEST ANSWER

You probably need this:

SELECT * 
FROM PRODUCT 
WHERE P_CODE in (SELECT P_CODE 
                 FROM LINE 
                 WHERE LINE_TOTAL > (select AVG(LINE_TOTAL) from LINE)
                );