List:General Discussion« Previous MessageNext Message »
From:John Daisley Date:September 10 2009 10:49am
Subject:RE: how to query this
View as plain text  
SELECT MAX(value), id FROM table


John Daisley
Mobile +44(0)7812 451238
Email john@stripped

Certified MySQL 5 Database Administrator (CMDBA)
Certified MySQL 5 Developer
Cognos BI Developer

Sent from HP IPAQ mobile device.

-----Original Message-----
From: Slackli User <slackliuser@stripped>
Sent: Thursday, September 10, 2009 10:43 AM
To: mysql@stripped
Subject: how to query this


sorry I'm not good at SQL statement.
I have a table, whose stru is like:

id        value
1          33
2          987
3          10
4          22

I want to get the max value and the corresponding id, using this sql:

select max(value),id from table;

but it won't work.

so what's the correct syntax? Thanks.

MySQL General Mailing List
For list archives:
To unsubscribe:

how to query thisSlackli User10 Sep
RE: how to query thisJohn Daisley10 Sep
  • Re: how to query thisWolfgang Schaefer10 Sep
    • Re: how to query thisSlackli User10 Sep
      • Re: how to query thisClaudio Nanni10 Sep