I'm working on Spring Boot Application using Maven and I'm using Sybase database and MyBatis as ORM framework.
I need to execute query like:
SELECT M.COL_A, M.COL_B, M.COL_C FROM MY_TABLE M
UNION
SELECT N.COL_A, N.COL_B, "" AS COL_C FROM MY_TABLE2 N;
Now MY_TABLE2 does not have COL_C column but I need to select it for union clause to work.
This query works fine as my database but gives me following error when executed via MyBatis:
com.sybase.jdbc3.jdbc.SybSQLException: Invalid column name ''.