how to combine tables with 1 to many relationship into 1 line of record
问题 I need to combine two tables with 1 to many relationship using union but to no success. I've been trying to use this code select a.equipmentid, a.codename, a.name, a.labelid, a.ACQUISITIONDATE, a.description from TBL_EQUIPMENTMST a where a.partofid = '57' union all select first 1 b.warrantyid, b.startdate, b.enddate from tbl_equipwarranty b inner join TBL_EQUIPMENTMST c on b.equipmentid=c.equipmentid where c.partofid = '57' and b.servicetype='service' order by b.warrantyid desc union all