|
Posted by Bent Stigsen on 06/02/06 22:28
Lorenzo Thurman wrote:
> I'm using PHP 5 to make an ODBC connection to an MS Access database
> using PEAR and I'm getting DB Error: Syntax Error when using the GROUP
> BY clause. Here's my query:
> SELECT * FROM HardwareInstallationsSummary WHERE LocationID = $loc_ID
> GROUP BY EquipmentTypeID
You have only told it *what* to group together, but it also needs to
know *how* it should do it.
> Just for kicks, I changed the GROUP BY to ORDER BY. The query works, and
> the items are sorted as expected, but this is not what I want. Is there
> a bug in here somewhere?
You need to spell it out for the ms-access thingy. As Janwillem
mentions, you use aggregate functions for that, and there might be
differences between different systems. So try at
"comp.databases.ms-access", and give them a bit more information about
the columns of the table you select from, and what you expect to happen.
/Bent
Navigation:
[Reply to this message]
|