System Ticket Rule - mysql
Need some assistance because I don't really know anything about mysql. Can anyone look at the error I am getting on a ticket rule and tell me/guide me to what needs to be done? Thanks in advance for any help:)
mysql error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' left join HD_TICKET_CHANGE_FIELD on HD_TICKET_CHANG' at line 13] in EXECUTE("SELECT COUNT(*) FROM (select distinct HD_TICKET.ID, HD_TICKET.OWNER_ID as OWNER_ID, HD_TICKET.ID as TICKNUM, HD_TICKET.TITLE, HD_STATUS.NAME AS STATUS_NAME, HD_STATUS.STATE as STATE, OWNER.USER_NAME as OWNER_NAME, OWNER.FULL_NAME as OWNER_FULLNAME, OWNER.EMAIL as OWNER_EMAIL, UPDATER.USER_NAME as UPDATERNAME, UPDATER.EMAIL as UPDATEREMAIL from (HD_TICKET, HD_STATUS) left join HD_TICKET_CHANGE on HD_TICKET_CHANGE.ID = left join HD_TICKET_CHANGE_FIELD on HD_TICKET_CHANGE_FIELD.HD_TICKET_CHANGE_ID = HD_TICKET_CHANGE.ID left join USER OWNER on OWNER.ID = HD_TICKET.OWNER_ID left join USER UPDATER on UPDATER.ID = HD_TICKET_CHANGE.USER_ID where HD_STATUS.ID = HD_TICKET.HD_STATUS_ID and HD_TICKET_CHANGE.HD_TICKET_ID= HD_TICKET.ID and HD_TICKET_CHANGE_FIELD.FIELD_CHANGED !='SATISFACTION_RATING' and HD_TICKET_CHANGE_FIELD.FIELD_CHANGED !='SATISFACTION_COMMENT' and HD_STATUS.ID in (127,126,108,156) and (UPDATER.ID <> OWNER.ID or OWNER.ID is NULL) and UPDATER.ID > 0 and HD_TICKET.HD_QUEUE_ID = '21') _ADODB_ALIAS_ LIMIT 1")
Community Chosen Answer
Your issue is related to the join at "left join HD_TICKET_CHANGE on HD_TICKET_CHANGE.ID = ". There is no value that is being compared and that is creating bad SQL. The most likely cause of this is a typo in the TOKEN you are using in the SQL itself. I'd recommend pasting the SQL from the ticket rule itself to identify the actual typo.
Answered 08/12/2015 by: CraigT
Please log in to comment
log in to commentPlease