Get more info from a MAX(ID), MIN(ID) MYSQL query?

Viewed 14062

How to get more columns from MAX(ID), MIN(ID) MYSQL query?

Currently I get only two values: MAX(ID) & MIN(ID) from this query:

SELECT MIN(ID), MAX(ID) FROM mytable WHERE mytable.series = 'white' ;

Need to get something like this-pseudo-query:

SELECT  column1, column2
FROM    mytable 
WHERE   series = 'white'
AND ID=Max(ID)
'AND GET ME ALSO'
WHERE   series = 'white'
AND ID=Min(ID);`

It should return 2 rows for the column 'series' that equals 'white'.

1st with column1 and column2 for ID=Min(ID). 2nd with column1 and column2 for ID=Max(ID).

But how?

3 Answers
Related