aruns Posted April 17, 2009 Share Posted April 17, 2009 Hi Guys , I have a problem please Help me . i have duplicate records from my MYSQL database Duplicate record means same price, same quantity and same product.. help me how to i get this list... Quote Link to comment https://forums.phpfreaks.com/topic/154495-hi-guys/ Share on other sites More sharing options...
Maq Posted April 17, 2009 Share Posted April 17, 2009 So what exactly do you want a list of? All the duplicate entries where all three fields match? Quote Link to comment https://forums.phpfreaks.com/topic/154495-hi-guys/#findComment-812327 Share on other sites More sharing options...
fenway Posted April 17, 2009 Share Posted April 17, 2009 Or remove the duplicates? I suggest you check the link in my sig and see how best to provide the forum members with info about your problem. Quote Link to comment https://forums.phpfreaks.com/topic/154495-hi-guys/#findComment-812336 Share on other sites More sharing options...
aruns Posted April 17, 2009 Author Share Posted April 17, 2009 product1 40 $9.98 $399 $0 $399 Order Now 0 stars product2 50 $9.38 $469 $0 $469 Order Now 0 stars product1 40 $9.98 $399 $0 $399 Order Now 0 stars product2 50 $9.38 $469 $0 $469 Order Now 0 stars product2 50 $9.38 $469 $0 $469 Order in this list product2 as two times repeated look like this i want a list of products which of the products are repeated... Quote Link to comment https://forums.phpfreaks.com/topic/154495-hi-guys/#findComment-812361 Share on other sites More sharing options...
gurroa Posted April 17, 2009 Share Posted April 17, 2009 select FIELDWITHPRODUKTNAME, count(FIELDWITHPRODUKTNAME) from YOURTABLE group by FIELDWITHPRODUKTNAME, FIELD1, FIELD2, FIELD3... all field identifing a duplicate Quote Link to comment https://forums.phpfreaks.com/topic/154495-hi-guys/#findComment-812437 Share on other sites More sharing options...
Maq Posted April 17, 2009 Share Posted April 17, 2009 Use something like: SELECT product, count(product) AS cnt FROM table GROUP BY product HAVING cnt > 1; Quote Link to comment https://forums.phpfreaks.com/topic/154495-hi-guys/#findComment-812444 Share on other sites More sharing options...
aruns Posted April 17, 2009 Author Share Posted April 17, 2009 I want to compare the three fields. I mean product_name, price, quantity are same its duplicate.. how to i get it Quote Link to comment https://forums.phpfreaks.com/topic/154495-hi-guys/#findComment-812523 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.