#19045 [Opn->Fbk]: SELECT DISTINCT with just ONE table doesn't work

From: Date: Thu, 03 Oct 2002 12:48:10 +0000
Subject: #19045 [Opn->Fbk]: SELECT DISTINCT with just ONE table doesn't work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-21375@lists.php.net to get a copy of this message
 ID:               19045
 Updated by:       kalowsky@php.net
 Reported By:      christophe.bidaux@netcourrier.com
-Status:           Open
+Status:           Feedback
 Bug Type:         ODBC related
 Operating System: IIS4 on NT4
 PHP Version:      4.2.2
 New Comment:

Open your ODBC Administrator and there should be tab that has a little
check box that says "Turn Logging On" I believe it's on the same tab as
the Pooling information.   


Previous Comments:
------------------------------------------------------------------------

[2002-10-03 01:40:16] christophe.bidaux@netcourrier.com

how I can turn the logging on ?

------------------------------------------------------------------------

[2002-10-02 12:28:21] kalowsky@php.net

Any chance you can re-do this with logging turned on?  I did some
research into this, and believe I've figured it out.... although I'd
like to see if your actions fall into the same series of steps as mine.

------------------------------------------------------------------------

[2002-08-31 00:17:41] kalowsky@php.net

Interestingly enough some digging into this results in the following
data:
The ODBC standard exec only supports the following options for a SELECT
statement:  FROM, WHERE, GROUP BY, HAVING, UNION, and ORDER BY.  

So technically doing a SELECT DISTINCT shouldn't ever work.  Although
your example seems to disprove this theory.  I'm going to have to do
more looking into this as I get time... as I don't think this should be
an issue.  It should be a SQL Driver issue, not an ODBC Driver issue.  

------------------------------------------------------------------------

[2002-08-30 03:10:23] christophe.bidaux@netcourrier.com

it doesn't work with :

$requete="select distinct POSTE from TEMPSCUMULES";

and it works with :

$requete="select POSTE from TEMPSCUMULES";

------------------------------------------------------------------------

[2002-08-29 16:52:00] kalowsky@php.net

$stmt1 ="select distinct POSTE, LBLPOSTE from TEMPSCUMULES where
SOCIETE='001' and ATELIER='40' and to_char(JOURNEE,'YYYYMMDD') between
'20020701' and '20020731' order by POSTE", it doesn't work.

$stmt2 ="select POSTE, LBLPOSTE from TEMPSCUMULES where
SOCIETE='001'and ATELIER='40' and to_char(JOURNEE,'YYYYMMDD') between
'20020701' and
'20020731' order by POSTE" 

$stmt3 ="select distinct GROUPE, POSTE,
LBLPOSTE from TEMPSCUMULES, GROUPE_MACHINE where POSTE=MACHINE and
SOCIETE='001' and ATELIER='40' and to_char(JOURNEE,'YYYYMMDD') between
'20020701' and '20020731' order by GROUPE, POSTE"

so $stmt2, and $stmt3 work fine.

Have you tried with a simplier select query?  

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/19045

-- 
Edit this bug report at http://bugs.php.net/?id=19045&edit=1



Thread (15 messages)

« previous php.bugs (#21375) next »