sql to get all sales order notes in magento 2
select `order`.`increment_id` as `Sales Order`, DATE(`note`.`created_at`) as `Date`, TIME(`note`.`created_at`) as `Time`, `note`.`comment` as `Note`
FROM `sales_order` AS `order`
JOIN `sales_order_status_history` as `note`
ON `note`.`parent_id` = `order`.`entity_id`;