Case:
I have a database with artikels (MySQL). Due to an error in our beta software package some artikels are double in database (meaning double eancodes - diffrent prices).
Now i have busting my head on a query to get an list of all artikels in database whos eancode is more than 1 time in the database. I got it working with an 'group by eancodeartikel' but that selects the double eancodes but doesnt show the 2 artikels maching the eancode. A college of mine said it could'nt be done in 1 query (only with making an temp table and start cleaning in there). I do not believe him.
However i said 'Time to call the pro's !'.
This is how far i got ... But it only gives me 1 record output. So there is an error in it.
SELECT
artikels.description,
artikels.eancodeartikel,
artikels.price
FROM
artikels
WHERE
(supplier = 'microsoft')
HAVING count(EANCODEARTIKEL) > 1
group by eancodeartikel
Help much appreciated.




