Re: Specifying multiple WHERE options within a group?
Wow, a wee spot of reading on JOINS and it all makes sense! Thanks Jay.
Btw, I spotted the deliberate typos with aup.UserID instead of uap.UserID and aud! :)
Quick question on optimisation, the qeury takes 21.47 seconds to run, whereas my many, many subqueries query takes only 0.27 seconds to run.
SELECT COUNT(*) FROM (SELECT * FROM UserActions AS ServeUsers,
(SELECT * FROM UserActions AS ConfirmUsers,
(SELECT * FROM UserActions AS RequestUsers,
(SELECT * FROM UserActions
WHERE Action LIKE "View%" GROUP BY UserActions.UserID) AS Views
WHERE RequestUsers.Action = "Request Download" GROUP BY RequestUsers.UserID) AS Requests
WHERE ConfirmUsers.Action = "Confirm Download" GROUP BY ConfirmUsers.UserID) AS Confirms
WHERE ServeUsers.Action = "Download" GROUP BY ServeUsers.UserID) AS Serves
I'd have thought the JOIN option would be far more efficient. Any suggestions?
Thanks again,
Callum.