12-09-2021, 02:19 PM
Code:
SELECT extintores_no as title, extintoresid as id, modifiedby as modifier, smownerid as owner, module, createdtime!=modifiedtime as haschanged
FROM vtiger_extintores
INNER JOIN vtiger_dart_recordchanges ON vtiger_extintores.extintoresid = vtiger_dart_recordchanges.crmid AND modifiedon='2021-12-09'
INNER JOIN vtiger_crmentity on vtiger_crmentity.crmid=vtiger_dart_recordchanges.crmid
Executing the previous code in MySQL gives the following errors:
#1052 - column: 'modifiedby' in field list is ambiguous
#1052 - column: 'smownerid' in field list is ambiguous
As suggested appending "vtiger_crmentity." to both of them (vtiger_crmentity.modifiedby & vtiger_crmentity.smownerid) solved the error.