Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have many tables which, for the sake of simplicity, are represented in a View in my MySQL database. My problem is that I need a value in this view representing if it is one kind of event or another (a simple boolean), which I tried to achieve with:

The problem is that it is somehow yelded to Int, where it should at least be bit, which I could use to do the mapping. The cast function doesn't intend to do that? Sorry if the question sounds dumb, I just don't have that much of a DB knowledge.
–
BrunoFeb 9 '12 at 19:15

Basically what you're saying is that in a View it is impossible to have a boolean value based on a calculation?
–
BrunoFeb 9 '12 at 19:26

Could it return 2 strings, instead of 0 and 1?
–
BrunoFeb 9 '12 at 19:28

Yes, you can. You need to use the IF function.
–
RolandoMySQLDBAFeb 9 '12 at 19:29