I need the second, third, fourth, etc messageID for each userID. So I would get a results table such as: | ID | messageID | userID | |----|-------------|--------| | 2 | 984 | 71 | | 5 | 441 | 73 | | 6 | 489 | 73 | | 7 | 483 | 74 | | 9 | 723 | 74 |
I've tried playing with count and group by and limit, but I've not found a solution. I can easily get all the rows and then remove the rows that I don't need in PHP, but I'd still like to know if an all-MySQL solution is possible.
Thanks!
-- Dotan Cohen
http://gibberish.co.il http://what-is-what.com
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=listsearcharchive@lassosoft.com
Oct 19
Michael Dykman Re: How to select the id of 2+ records for given user?
Oct 19, 2011; 13:32
Michael Dykman
Re: How to select the id of 2+ records for given user?
Oct 19
Derek Downey Re: How to select the id of 2+ records for given user?
Oct 19, 2011; 13:43
Derek Downey
Re: How to select the id of 2+ records for given user?
Oct 19
Basil Daoust Re: How to select the id of 2+ records for given user?
Oct 19, 2011; 17:06
Basil Daoust
Re: How to select the id of 2+ records for given user?
Oct 19
Derek Downey Re: How to select the id of 2+ records for given user?
Oct 19, 2011; 18:11
Derek Downey
Re: How to select the id of 2+ records for given user?
Oct 20
Dotan Cohen Re: How to select the id of 2+ records for given user?
Oct 20, 2011; 02:09
Dotan Cohen
Re: How to select the id of 2+ records for given user?
Oct 20
Dotan Cohen Re: How to select the id of 2+ records for given user?
Oct 20, 2011; 02:18
Dotan Cohen
Re: How to select the id of 2+ records for given user?
Oct 20
Hal?sz S?ndor Re: How to select the id of 2+ records for given user?
Oct 20, 2011; 10:08
Hal?sz S?ndor
Re: How to select the id of 2+ records for given user?
Oct 21
Dotan Cohen Re: How to select the id of 2+ records for given user?
Oct 21, 2011; 00:01
Dotan Cohen
Re: How to select the id of 2+ records for given user?
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!