SELECT di.customer_code ,di.create_date ,di.create_time ,cu.customer_name1 ,cu.customer_name2 ,sd.download_date ,di.invoice_id FROM invoice_search_index di LEFT OUTER JOIN customer cu ON di.customer_code = cu.customer_code LEFT OUTER JOIN ( SELECT invoice_id ,create_time ,MIN(download_date) as download_date FROM download_history_invoice WHERE admin_id = 0 AND member_id = 1373 GROUP BY invoice_id, create_time) sd ON di.invoice_id = sd.invoice_id AND di.create_time = sd.create_time WHERE di.customer_code IN ( SELECT customer_code FROM reading_group_customer WHERE customer_group = '19116000' AND any_code = '19116-1') AND di.create_date >= '2024-07-28' AND di.customer_code IN ( SELECT customer_code FROM customer WHERE customer_name1 LIKE '%株式会社田川商事%') ORDER BY di.create_time DESC, di.customer_code LIMIT 1001