select
objt.OBJT as objt_id,
objtc.objt ,
objt.PVOB as objt_perid,
objt.POID as objt_origin_id,
objt.code as objt_code,
objt.name as objt_name,
txt.TDAT as objt_comment,
objtc.code as objtc_code,
objtc.name as objtc_name,
txtc.TDAT as objtc_comment,
ocrusr.name as objt_create_user,
objt.OCDT as objt_create_date,
oupusr.name as objt_modity_user,
objt.OMDT as objt_modify_date,
objt.CUSR as modelt_create_user,
objt.CDAT as modelt_create_date,
objt.MUSR as modelt_modify_user,
objt.MDAT as modelt_modify_date,
objtc.OMDT as objtc_modify_date,
objtc.CUSR as modelc_create_user,
objtc.CDAT as modelc_create_date,
objtc.MUSR as modelc_modify_user,
objtc.MDAT as modelc_modify_date
from
meta_database.pmobjt objt
left join meta_database.pmclss obcls on objt.clss=obcls.CLSS
left join meta_database.pmuser ocrusr on objt.OCUS=ocrusr.RUSR
left join meta_database.pmuser oupusr on objt.OMUS=oupusr.RUSR
left join meta_database.pmtext txt on objt.CMMT=txt.TXID
left join meta_database.pmrlsh prl on objt.OBJT=prl.SRCE
left join meta_database.pmobjt objtc on objtc.objt=prl.TRGT
left join meta_database.pmtext txtc on objtc.CMMT=txtc.TXID
where
obcls.name in('Table')
order by objt.code,objt.OBJT,objtc.objt
;