Max() function doesn`t return maximum value

I have such data in my table :
rcountID(int(11))-----rcountName(varchar(255))
1--------------------89-000011
2--------------------89-000012
3--------------------89-000013

in above table rcountID is primary key and rcountNumber is unique key .
I wrote query to get maximum value of rcountID but final result shows me all available data :

SELECT MAX(ym_receipt_counter.rcountID) AS maximum,
       ym_receipt_counter.rcountNumber
From ym_receipt_counter
GROUP BY ym_receipt_counter.rcountID;
also this one doesn`t work :
SELECT MAX(ym_receipt_counter.rcountName) AS maximum,
       ym_receipt_counter.rcountID
From ym_receipt_counter
GROUP BY ym_receipt_counter.rcountID;

Im confused , whats wrong ?


SELECT MAX(ym_receipt_counter.rcountID) AS maximum
FROM ym_receipt_counter

but I need to select both rcountID and rcountNumber .
How can I select both of them ?

SELECT rcountID 
     , rcountNumber
  FROM ym_receipt_counter
[COLOR="Blue"]ORDER 
    BY rcountID DESC LIMIT 1[/COLOR]

Sweet :slight_smile: