Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chakravarthykalyan90/11f847c6731c55ba4649d6d7d4fe0771 to your computer and use it in GitHub Desktop.
Save chakravarthykalyan90/11f847c6731c55ba4649d6d7d4fe0771 to your computer and use it in GitHub Desktop.
SELECT `quote_id`,
COUNT(`quote_id`) AS `duplicate_count`,
`increment_id` AS `first_increment_id`,
GROUP_CONCAT( `increment_id` SEPARATOR ' | ' ) AS `increment_ids`,
`created_at`,
`state`,
`status`,
`customer_email`,
`grand_total`
FROM `sales_flat_order`
GROUP BY `quote_id`
HAVING COUNT(`quote_id`) > 1
ORDER BY `created_at` ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment