Hi,
I have an interesting problem. I have a sql generator that reads a data model and creates the corresponding SQL. Its generated SQL runs in MySQL Workbench but fails in my appliction with the following exception:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Not unique table/alias: 'AlertStatus'
Here is the very simple SQL Statement. Any ideas? Thanks in advance
SELECT
Alert.AlertID,
AlertType.Image,
AlertStatus.Status,
Alert.Date,
Alert.Alert,
Alert.Description,
Alert.Exception,
AlertDomain.Domain,
Organization.Name
FROM Alert
INNER JOIN AlertStatus ON Alert.AlertStatusID = AlertStatus.AlertStatusID
INNER JOIN AlertType ON Alert.AlertTypeID = AlertType.AlertTypeID
INNER JOIN AlertDomain ON Alert.AlertDomainID = AlertDomain.AlertDomainID
INNER JOIN Organization ON Alert.OrganizationID = Organization.OrganizationID
WHERE 1=1 LIMIT 0,20
I have an interesting problem. I have a sql generator that reads a data model and creates the corresponding SQL. Its generated SQL runs in MySQL Workbench but fails in my appliction with the following exception:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Not unique table/alias: 'AlertStatus'
Here is the very simple SQL Statement. Any ideas? Thanks in advance
SELECT
Alert.AlertID,
AlertType.Image,
AlertStatus.Status,
Alert.Date,
Alert.Alert,
Alert.Description,
Alert.Exception,
AlertDomain.Domain,
Organization.Name
FROM Alert
INNER JOIN AlertStatus ON Alert.AlertStatusID = AlertStatus.AlertStatusID
INNER JOIN AlertType ON Alert.AlertTypeID = AlertType.AlertTypeID
INNER JOIN AlertDomain ON Alert.AlertDomainID = AlertDomain.AlertDomainID
INNER JOIN Organization ON Alert.OrganizationID = Organization.OrganizationID
WHERE 1=1 LIMIT 0,20