mysql query question
mysql query question
- Started
- Last post
- 3 Responses
- kinetic
this is hard to explain so let me just outline the table structure first:
field1 = auto_incremement
1
2
3
4field 2 = ses_id
1
1
2
2so there are 4 entries in the table....i want to select the highest auto_increment value from the table for each of the ses_ids.
so it would be select 2 from ses_id 1 and select 4 from ses_id 2
how would i structure the sql query to achieve this?
thanks for your help...i suck at sql
- smokie0
SELECT MAX(auto_increment) FROM table GROUP BY ses_id
....that probably wont work!
:)¬
- kinetic0
it worked like charm!
thanks smokie, you are my hero for today ;)
- smokie0
WOO HOO!!!
:)¬