Forums: Mysql Mind Buster | Non Security Related. - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Mysql Mind Buster | Non Security Related.

#1 User is offline   Partizaan 

  • Sergeant First Class
  • Icon
  • Group: Members
  • Posts: 367
  • Joined: 13-February 04

Posted 17 May 2005 - 05:07 AM

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.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

  • Share



Our Sponsors:


SwiftLayer Affiliate Web Hosting