Is there a way to return an int value for a boolean field in a sql select statement?
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. Join them; it only takes a minute:
Here's how it works:
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
I think this is not SQL Server. Maybe PostgreSQL? Try this
If that is really a boolean column, you can do this:
that way you can also return other values than 1/0 if you need to.