Maybe because it's early in the morning, but when I read the `CASE 1 WHEN EMP_ID < 10 THEN ... ELSE ... ` my brain kind of froze and I had to look up CASE again to get what you were doing. I'm curious as to why you would write it that way rather than `CASE WHEN EMP_ID < 10 THEN ... ELSE ... ` ? It seems non-intuitive and works only in SQLite because of TRUE becoming 1, and wouldn't work in any DBMS which has a dedicated boolean type.