I would like to name a column ‘count’, but I’m worried it could cause problems as I already have a lot of queries written that use count(*) as `count
Will that cause problems?
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.
I’d not recommend it, as it’s a reserved word, but if you must, you can escape it with backticks:
As far as what you already have, you can still use both queries. The
COUNT(*) AS 'count'will return a single row with a single column, ‘count’. TheSELECT 'count'way will return it as a normal column.Also, note that I used ‘ instead of ` in the last sentence, just because SO uses ` to denote code.
All in all, it’s a bad idea.