MySQL Forums
Forum List  »  InnoDB

Re: Group by
Posted by: Aram Karapetyan
Date: January 07, 2006 01:06AM

I'm sorry It's my mistake.

table

id | col1 | col2 | col3 | col4
---------------------------------
1 | a1 | b1 | s1 | sda | dsaf
2 | a1 | b2 | s2 | dsf | sdafas
3 | a1 | b3 | s3 | sdf | sdfsdf
4 | a2 | c1 | s4 | fdsdf | sdf
5 | a2 | c2 | s5 | sdf | sdf
6 | a2 | c3 | s5 | sdf | dsf
--------------------------------

SELECT * from table1
group by col1

after this query I'll have

1 | a1 | b1 | s1 | sda | dsaf
4 | a2 | c1 | s4 | fdsdf | sdf
because these lines first in group

I need to get "for example" last lines
3 | a1 | b3 | s3 | sdf | sdfsdf
6 | a2 | c3 | s5 | sdf | dsf

Thanks.

Options: ReplyQuote


Subject
Views
Written By
Posted
3279
January 06, 2006 06:34AM
1782
January 06, 2006 01:55PM
Re: Group by
1723
January 07, 2006 01:06AM
1744
January 07, 2006 02:49AM
1861
January 08, 2006 07:42AM
1855
January 08, 2006 07:53AM


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.