Trying to write a SQL query to display only the "part number" with multiple warehouse "locations". I want a search that will display each "partno" that has more than one "boxSize" and/or "boxLocation". There is only one table where the data that I need resides.
DISTINCT partno, COUNT(partno) AS MULTIPLE_PARTNO
GROUP BY partno
HAVING COUNT(partno) <> '1'
asked Jul 27, 2013 at 01:39 AM in Default
Great question! Try This:
SELECT partno, boxSize, Count(partno) as MULTIPLE_PARTNO
This is assuming that PartNo only appears more then once when it has more then 1 boxSize.
Let me know if that works.