try this, it is not exactly what you need, but with i am sure thatt you can alter this query to your needs
SELECT a.name, d.tvalue,d.ivalue,d.comments,e.fileid, e.pack_loc,h.name as name_server,h.id,a.comment FROM devices d left join download_enable e on e.id=d.ivalue LEFT JOIN download_available a ON e.fileid=a.fileid LEFT JOIN hardware h on h.id=e.server_id WHERE d.name='DOWNLOAD' and a.name != '' and pack_loc != '' AND d.hardware_id=18839 union SELECT 'REMOVED PACKAGE', d.tvalue,d.ivalue,d.comments,e.fileid, 'REMOVED PACKAGE',h.name,h.id,a.comment FROM devices d left join download_enable e on e.id=d.ivalue LEFT JOIN download_available a ON e.fileid=a.fileid LEFT JOIN hardware h on h.id=e.server_id WHERE d.name='DOWNLOAD' and a.name is null and pack_loc is null AND d.hardware_id=18839
you must change the hardware id to to a existing one in your database query