I have some SQL code, and when I run it, I get an error:
SELECT AVG (DISTINCT E.salary) AS avrage
FROM aircraft AS A, certified AS C, employees AS E
WHERE A.cruisingrange > 1000
AND A.aid = C.aid
AND C.eid = E.eid
Error:
How can I fix this error?

countwhere your current query is withavg.JOINsyntax in the ANSI-92 SQL Standard (more than 25 years ago) and its use is discouragedAVG(DISTINCT)is basically never the right solution to a problem. What are you trying to calculate?