peterfelts
July 22nd, 2005, 01:18 PM
Hi, I'm coming from a MySQL background and I'm having problems with MS Access.
I'm using a VC++.NET app to query Access and have been running into problems so I decided to try my queries from Access directly.
My questions are:
1) Is there a way to simply select all fields in a table and do a group by:
SELECT Product.*, COUNT(*) FROM `Product` GROUP BY Product.[Prdouct reference]
This is easily done in MySQL but it looks like I have to type every field I want in the result when I do a function such as COUNT(*)?
What's up with that?
2) When I limit the columns in my result with something like this:
SELECT Product.[Product reference], Count(*) AS num_duplicates, Product.[Short description]
FROM Product RIGHT JOIN Product AS leftjoin ON Product.[Product reference] = leftjoin.sOriginalProdRef
GROUP BY Product.[Product reference], Product.[Short description];
I get garbled text in the `Short description` field for some reason. Does anyone know why this is happening?
thanks everyone.
I'm using a VC++.NET app to query Access and have been running into problems so I decided to try my queries from Access directly.
My questions are:
1) Is there a way to simply select all fields in a table and do a group by:
SELECT Product.*, COUNT(*) FROM `Product` GROUP BY Product.[Prdouct reference]
This is easily done in MySQL but it looks like I have to type every field I want in the result when I do a function such as COUNT(*)?
What's up with that?
2) When I limit the columns in my result with something like this:
SELECT Product.[Product reference], Count(*) AS num_duplicates, Product.[Short description]
FROM Product RIGHT JOIN Product AS leftjoin ON Product.[Product reference] = leftjoin.sOriginalProdRef
GROUP BY Product.[Product reference], Product.[Short description];
I get garbled text in the `Short description` field for some reason. Does anyone know why this is happening?
thanks everyone.