Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Need help with complex MySQL query... any takers?
How about
select a.id, a.name, a.value from testquery a, (select max(id) as id, name from testquery group by name) b
where a.id = b.id
Results
id name value
3 lion meat
2 monkey apple
5 snake insect
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: Need help with complex MySQL query... any takers?
MattD, was just about to go to bed but I think you’ve cracked it! Top work.
Sam Brown
sambrown.me | welovetxp.com
Offline
Re: Need help with complex MySQL query... any takers?
No problem. I should have had it write on the first try!
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: Need help with complex MySQL query... any takers?
Thanks again. The final statement looks like so:
select * from updates a, (select max(id) as id, name from updates group by name) b where a.id = b.id
Last edited by Sam (2008-07-02 23:12:06)
Sam Brown
sambrown.me | welovetxp.com
Offline