MySQL Forums
Forum List  »  Newbie

Re: DELETE rows?
Posted by: Shah Sahab
Date: June 18, 2010 09:43AM

Chad Bourque Wrote:
-------------------------------------------------------
> Shah,
>
> Well, in that case, group by both id and number
> and max the indx column.
>
> HTH,
> Chad

Well, that's the thing. It is not guaranteed that the higher indx will also have the higher value of number for the case when the values of number are different.

indx, id, number,
0, "id1", 20
1, "id2", 3 <- need to delete this even though its indx is lower
2, "id2", 1
3, "id3", 4 <- either delete this or indx == 6
4, "id4", 1
5, "id3", 6 <- need to delete this (indx is higher)
6, "id3", 4 <- either delete this or indx == 3

Options: ReplyQuote


Subject
Written By
Posted
June 15, 2010 08:53PM
June 15, 2010 10:38PM
June 15, 2010 11:23PM
June 16, 2010 02:29AM
June 16, 2010 07:44AM
June 17, 2010 10:07PM
June 17, 2010 11:40PM
Re: DELETE rows?
June 18, 2010 09:43AM
June 18, 2010 10:26AM
June 19, 2010 07:26AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.