Reference: https://bbs.csdn.net/topics/330032307
There is a dictionary table in the database, which contains the ID field and the corresponding name fields.
In another record table, there is a corresponding ID for the dictionary table above, and there are multiple fields that contain the ID field. It needs to be identified and used by name.
SELECTa.ID as 'numbering',' Story' as 'type', A.title as 'title', B.name as 'Affiliated Projects', A.project as 'Affiliated Projects', C.realname as 'created by', A.estimate as 'Scheduled Time', D.realname as 'Responsibility Research', A.resolveddate as 'Actual resolution Time', A.closeddate as 'Actual shutdown Time', A.status fromzt_story A, zt_project B, Zt_user C, Zt_user DWHEREA.project=b.ID andA.openedby=C.account andA.assignedto=D.account anda.ID>=8650 anda.ID<= 8692ORDER bya.idSELECTa.ID as 'numbering','BUG' as 'type', A.title as 'title', B.name as 'Affiliated Projects', C.realname as 'created by', A.estimatedonedate as 'Scheduled Time', D.realname as 'Responsibility Research', A.resolveddate as 'Actual resolution Time', A.closeddate as 'Actual shutdown Time', A.status fromZt_bug A, zt_project B, Zt_user C, Zt_user DWHEREA.project=b.ID andA.openedby=C.account andA.assignedto=D.account anda.ID>=28095ORDER bya.ID
Multiple fields in a table need to be associated with a dictionary table, how to write SQL query statements