Skip to content

Instantly share code, notes, and snippets.

@zeloc
Created August 16, 2018 08:11
Show Gist options
  • Save zeloc/e0f304ac6d3e19c8e215950a12148df1 to your computer and use it in GitHub Desktop.
Save zeloc/e0f304ac6d3e19c8e215950a12148df1 to your computer and use it in GitHub Desktop.
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`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment