I want to take the increment id from sales order table and status should be complete.I have created one custom table called hydrogen_xml_generation.
Initially the xml generated status is 0. Once the xml is generated it will be 1. How to write the below query in Magento 2.
$sales_shipment = $connection->fetchAll("SELECT increment_id FROM sales_order WHERE status = 'complete' AND sales_order.increment_id NOT IN (SELECT increment_id FROM hydrogen_xml_generation WHERE xml_generated = '1')");