NonUniqueDiscoveredSqlAliasException: Encountered a duplicated sql alias [ASC_ID] during auto-discovery of a native-sql query

CREDENTIAL_USER { ASC_ID, name, ITEM}, CREDENTIAL_USER { MONTH, YEAR, ASC_ID} both contain ASC_ID so ASC_ID becomes ambiguous in select query. Select your data column wise and give separate alias for each column


When using coalesce for the first time, I also run into this problem. I have solved it by writing:

...
coalesce(column_name, 'default_value') as key_word,
...

in my query.

Adding just coalesce(column_name, 'default_value'), creates several values with alias coalesce and this error occurs.