select rdl.*, rl.id mlid, rl.rl_config, rtg.*, rsg.path sidpath from reg_dok_linki rdl right join reg_dok rd on (rdl.did=rd.id) right join reg_linki rl on (rdl.lid=rl.id) right join reg_template_groups rtg on (rdl.template=rtg.tbid) right join reg_sekcje_groups rsg on (rdl.actsection=rsg.sid) where rl.id=23314 and rd.id=6127 and rl.newlink='1' and rtg.groups IN (0,1) and rsg.groups IN (0,1) order by rsg.groups DESC, rtg.groups DESC limit 1select r1.id mdid, d1.*,d1.lid mlid, r1.*, t1.* from reg_dok_linki d1 right join reg_dok r1 on (d1.did=r1.id) right join reg_doktype t1 on (r1.doctyp=t1.id) where d1.vtimeb='0' and d1.vtimee='0' and d1.lid='23314' order by r1.doctimebeg DESC select * from rel_mmedia_dok z1 right join lib_multimedia z2 on (z1.mfile=z2.lib_parent) where z1.did='23314' and z1.doctyp IN (4,8) order by z1.pozselect r1.id mdid, d1.dname dokdname, d1.*, r1.* from reg_dok_linki d1 right join reg_dok r1 on (d1.did=r1.id) where d1.vtimeb='0' and d1.vtimee='0' and d1.lid IN (23314) order by r1.doctimebeg DESC Oferty pracy - ArchiDoc