I am new in learning Magento. I need to create query like this,
SELECT *
FROM YourTable
WHERE ARIDNR IN (
SELECT ARIDNR
FROM YourTable
GROUP BY ARIDNR
HAVING COUNT(*) > 1
)
How to write this using collection method or any other method?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityCreate Model that link with table YourTable.
$Collection = Mage::getModel('module/model')->getCollection();
$Collection->getSelect()->group('ARIDNR')->having('COUNT(*) > ?', 1);