You are using group by but without any aggregate function so use MAX()
this will resolve the problem to get the highest value for you field
select j.id,j.code,MAX(j.tid)tid,MAX(j.iid) iid ,
t.*,i.*
from jointable j
left join tid_table t on t.id = j.tid
left join iid_table i on i.id = j.iid
group by code
If you want to search for your code you can do so See search demo
Demo
Other way you can use a subselect based on the maxima your columns
select j.id,j.code,MAX(j.tid)tid,MAX(j.iid) iid ,
t.*,i.*
from
(SELECT id,code,MAX(tid)tid,MAX(iid) iid FROM jointable group by code)
j
left join tid_table t on t.id = j.tid
left join iid_table i on i.id = j.iid
group by code