SQL Query to Find Duplicate Increment_ID From Order Table
Upgrading Magento stores can be quite a daunting task.
Moreover, you may face errors or issues if the upgrade process is not handled with expertise.
For instance, an issue of duplicate record from the order table arises while upgrading the store.
In this case, you can simply run an SQL query to find duplicate increment_ID from the order table in Magento 2 store. Not only during the upgrade process but in any case where you want to find the duplicate entries in the order table, use the below solution. Additionally in Magento 2 use SQL Query for case sensitive data as it is crucial for scenarios like these.
P.S: If you don’t want to go through such issues while the upgrade process, opt for the professional Magento Upgrade Service by Meetanshi!
SQL Query to Find Duplicate Increment_ID From Order Table
1 |
SELECT increment_id FROM sales_flat_order group by increment_id having count(*) >= 2 |
Find duplicate increment_id and modify the records that have duplication!
That’s all!
If you have any doubts regarding this SQL query, do mention them in the Comments section below.
I would be happy to help.
Feel free to share the solution with Magento Community via social media.
Thank You.
Jignesh Parmar
An expert in his field, Jignesh is the team leader at Meetanshi and a certified Magento developer. His passion for Magento has inspired others in the team too. Apart from work, he is a cricket lover.
Prev
How To Get Current Category Name in Magento 2
How to Show Popup After “Add to cart” Action in Magento 2
Next