Hi everybody,
I am writing an SQL query of the following form:
SELECT
(SELECTCOUNT(*) FROM DataTable WHERE Condition1 AND Condition2),
(SELECTCOUNT(*) FROM DataTable WHERE Condition1 AND Condition3),
(SELECTCOUNT(*) FROM DataTable WHERE Condition1 AND Condition4),
(SELECTCOUNT(*) FROM DataTable WHERE Condition1 AND Condition5),
user.id
FROM UserTable userwhere Condition1 depends on user and is the same for all four COUNT(*) subqueries. This query is very slow, and I believe that it can be sped up significantly if Condition1 would be checked once rather than four times. With a Com
