I am trying to get a true / false value in a column in a select expression that indicates whether count> 0 or not.
I read these documents: http://dev.mysql.com/doc/refman/5.1/en/expressions.html
Which I don’t quite understand, but they seem to indicate that I can use “→” in my expression.
So, I tried this:
SELECT COUNT(*)>>0 AS my_bool FROM table GROUP BY id;
It starts and does not generate errors or warnings, but the column my_boolcontains only the results COUNT(*). This is what I'm trying to do, if so, how?
PS Yes, I know that I could just check x> y in my code that processes the results, I want to know if this could be something that can only be done in MySQL (feel free to explain why this is not practical, everyone means)
source
share