DISTINCTROW & count(*)
| From: | Adriana Matiaskova | Date: | Mon, 12 Mar 2001 21:15:02 +0000 |
| Subject: | DISTINCTROW & count(*) | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-7351@lists.php.net to get a copy of this message | ||
Hi,
I'm using PHP with Access 97 through ODBC drivers.
How can I find number of records when I use DISTINCTROW?
I'm trying
"SELECT DISTINCTROW count(*), PERSON_ID, Name, ...
FROM PERSONS, ADDRESSES, FIRMS WHERE
PERSONS.FIRM_ID=ADDRESSES.FIRM_ID AND ADDRESSES.FIRM_ID=FIRMS.FIRM_ID"
but it doesn't work.
Error message seems like:
"Microsoft][ODBC Microsoft Access 97 Driver] You tried to execute a
query that doesn't include the specified expression 'PERSON_ID' as
part of an aggregate function., SQL state S1000 in SQLExecDirect
in gentable.php on line 121"
I can't use ODBC_Num_Rows, it always returns -1.
Thanks.