I've MYSQL Query with SUM & CROSS JOIN, its working fine.
MYSQL QUERY:
SELECT SUM(totexec/(pass_count+fail_count))/d.total COUNT FROM test_schedule CROSS JOIN ( SELECT COUNT(*) total FROM test_schedule WHERE project='JupiterQA' ) d WHERE project='JupiterQA'
But I'm trying to execute this same query in MSSQL in showing "Column 'd.total' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause."
After that I added GROUP BY a.total in end of the query, ERROR IS: Divide by zero error encountered.
I've records in all the table,Is Query wrong?