Optimize this mysql query

Santa Moon

New Member
Can some one optimize this mysql query \[code\]SELECT submittedform.*, inspectors.first_name, inspectors.last_name FROM ( SELECT `dinsp`,`departure`,`arrival`,'cabin' as type FROM cabinets UNION SELECT `dinsp`,`departure`,`arrival`,'cockpit' as type FROM cockpits ORDER BY `date_of_inspection` ASC ) AS submittedform INNER JOIN inspectors ON inspectors.id = submittedform.dinsp\[/code\]I don't want to rely on nested query or is it fine in this case? Also suggest me a cakephp solution but the tables can't be related.
 
Back
Top