Subject | RE: [firebird-support] Problem group by in front-end (odbc) |
---|---|
Author | Larry Johnson |
Post date | 2008-12-21T21:11:40Z |
Hmmm. I'm not sure what the issue might be. I tried a very similar
statement to yours, and it works fine in 2.1. Here's my test:
SELECT AL5.NAME FROM SYSDBA.MEDIATYPE AL5 WHERE (AL5.MEDIATYPE_ID IN (2, 3,
4)) group by AL5.NAME ORDER BY 1 DESC
(The aliasing shouldn't be necessary, I wouldn't think.)
This might be an Access issue. In any case, a couple of workarounds you
could try with your SQL:
1) Add something to the query that might normally require a GROUP BY
clause: Example:
SELECT TPROJEKTE.KOMMISIONSNR, count(1)
FROM TPROJEKTE
WHERE (((TPROJEKTE.KUNDE)=[forms]![FAuftragNeu].[skunde]))
GROUP BY TPROJEKTE.KOMMISIONSNR
ORDER BY TPROJEKTE.KOMMISIONSNR DESC;
2) Replace the GROUP BY with a DISTINCT option on the SELECT list:
SELECT DISTINCT TPROJEKTE.KOMMISIONSNR
FROM TPROJEKTE
WHERE (((TPROJEKTE.KUNDE)=[forms]![FAuftragNeu].[skunde])) ORDER BY
TPROJEKTE.KOMMISIONSNR DESC;
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of olaf.kluge@...
Sent: Sunday, December 21, 2008 12:35 PM
To: firebird-support@yahoogroups.com
Subject: RE: [firebird-support] Problem group by in front-end (odbc)
Hi,
the error message: odbc aufruf fehlgeschlagen (odbc call failed) The
orderby-statement is the problem, but I brougth the data sorted by desc not
asc (automatically without ourderby-statement)
I also must group by, without group by the statement works well.
Olaf
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
statement to yours, and it works fine in 2.1. Here's my test:
SELECT AL5.NAME FROM SYSDBA.MEDIATYPE AL5 WHERE (AL5.MEDIATYPE_ID IN (2, 3,
4)) group by AL5.NAME ORDER BY 1 DESC
(The aliasing shouldn't be necessary, I wouldn't think.)
This might be an Access issue. In any case, a couple of workarounds you
could try with your SQL:
1) Add something to the query that might normally require a GROUP BY
clause: Example:
SELECT TPROJEKTE.KOMMISIONSNR, count(1)
FROM TPROJEKTE
WHERE (((TPROJEKTE.KUNDE)=[forms]![FAuftragNeu].[skunde]))
GROUP BY TPROJEKTE.KOMMISIONSNR
ORDER BY TPROJEKTE.KOMMISIONSNR DESC;
2) Replace the GROUP BY with a DISTINCT option on the SELECT list:
SELECT DISTINCT TPROJEKTE.KOMMISIONSNR
FROM TPROJEKTE
WHERE (((TPROJEKTE.KUNDE)=[forms]![FAuftragNeu].[skunde])) ORDER BY
TPROJEKTE.KOMMISIONSNR DESC;
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of olaf.kluge@...
Sent: Sunday, December 21, 2008 12:35 PM
To: firebird-support@yahoogroups.com
Subject: RE: [firebird-support] Problem group by in front-end (odbc)
Hi,
the error message: odbc aufruf fehlgeschlagen (odbc call failed) The
orderby-statement is the problem, but I brougth the data sorted by desc not
asc (automatically without ourderby-statement)
I also must group by, without group by the statement works well.
Olaf
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]