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.

Can you paste the exact code you're using? From the error posted it looks like you don't have a space between THEN and 0 (and ELSE and 1, for that matter).
–
Simon RighartsNov 12 '13 at 11:08

Thanks for the message; I will update the answer shortly with simplified example code. My original view works properly and there are no syntax errors.
–
Ivanhoe123Nov 12 '13 at 11:39

I added sample SQL for creating necessary tables and steps to reproduce the issue.
–
Ivanhoe123Nov 12 '13 at 11:49

2

This is the kind of thing you should test in the MySQL command line client, because it sounds like phpmyadmin, which is 3rd party software, might be breaking your query, if I understand the issue as you describe it, as opposed to a problem in MySQL.
–
Michael - sqlbotNov 12 '13 at 12:41