Hi,
I have access db and I'm trying to display a distinct item_ID, the primaryKey, and price for the corresponding record.
This is the query I'm using.
SELECT DISTINCT item_ID, primaryKey, min(price) FROM products WHERE status = 'NEW' GROUP BY item_ID
The problem is that is gives me a huge result and it should only give me one. Since the primaryKey is unique it is printing all of them, i just want the DISTINCT to apply to the item_ID and not to the price or primaryKey.
If I take these 2 out, it works.
Any ideas.
Thanks,
sbayter
I have access db and I'm trying to display a distinct item_ID, the primaryKey, and price for the corresponding record.
This is the query I'm using.
SELECT DISTINCT item_ID, primaryKey, min(price) FROM products WHERE status = 'NEW' GROUP BY item_ID
The problem is that is gives me a huge result and it should only give me one. Since the primaryKey is unique it is printing all of them, i just want the DISTINCT to apply to the item_ID and not to the price or primaryKey.
If I take these 2 out, it works.
Any ideas.
Thanks,
sbayter