I usally use MAX() or MIN() if a DBMS hasn’t an ANY() aggregate function.
Is there something less expensive in mySQL and MS-SQL?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
MySQL does not need an ANY() aggregate.
if I do a
Microsofts T-SQL will complain but
MySQL will just silently execute
Which of course is way faster than
SELECT max(field1), field2, SUM(.... GROUP BY field2MySQL supports
ANY, butSELECT ANY(field1) ...doesn’t work becauseANYis an operator similar toINandALL.see: http://dev.mysql.com/doc/refman/5.0/en/any-in-some-subqueries.html
I love MySQL