php-windows Digest 17 Mar 2003 08:46:28 -0000 Issue 1638

Topics (messages 19032 through 19032):

Re: ODBC Query max()
        19032 by: Svensson, B.A.T. (HKG)

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
First of all it looks strange to have a assign condition in
the SELECT part of the query, e.g "ID = max(ID)". 

You might like to do it this way instead:

SELECT ID,Date,TimeIn,TimeOut,StationIP
FROM Clocks
WHERE ID = (
    SELECT MAX(ID)
    FROM Clocks)
  



-----Original Message-----
From: GeneralX
To: [EMAIL PROTECTED]
Sent: 2003-03-15 06:46
Subject: [PHP-WIN] ODBC Query max()

I'm trying to extract one record that has largest sequence ID number
for an employee, so I've tried below but doesn't work.  Help.

$mQuery = "EmployeeID = '$user'";
$mCur = odbc_exec( $mCnx, "select
ID=max(ID),Date,TimeIn,TimeOut,StationIP
from Clocks where $mQuery" );


--- End Message ---

Reply via email to