SELECT 
	p.tag_serial,q.hardware_serial 
FROM 
	Assembly 
	LEFT JOIN Product p USING(prod_id) 
	LEFT JOIN AssemblyProduct ap ON Assembly.assem_id=ap.assem_id 
	LEFT JOIN Product q ON ap.prod_id=q.prod_id 
WHERE 
	datetime > '2005-04-01' AND 
	SUBSTRING(p.tag_serial,3,1)='5' 
ORDER BY 
	RIGHT(p.tag_serial,4);
