Re: Sort and remove duplicates



On Fri, 28 Sep 2007 06:10:54 -0700, JimJx wrote:

Hi everyone,

Got what should be an easy problem.

I have a db (MySQL) that I need to sort on the first field and remove
dups from.

For example, let's say I have Red,1,2,3,4,5 and Blue,1,2,3,4,5 and
Green,1,2,3,4,5 and Green,2,2,2,2,2

How can I come out with Blue,1,2,3,4,5;Green,1,2,3,4,5;Red,1,2,3,4,5??

I know that there is a simple way to do this but my brain is not
functioning right now.

select field1, min(field2), min(field3) ... from table group by field1;

HTH,
M4
.



Relevant Pages

  • Re: Sort and remove duplicates
    ... I have a db (MySQL) that I need to sort on the first field and remove ... dups from. ...
    (comp.lang.perl.misc)
  • Sort and remove duplicates
    ... I have a db (MySQL) that I need to sort on the first field and remove ... dups from. ...
    (comp.lang.perl.misc)
  • Re: Sort and remove duplicates
    ... I have a db that I need to sort on the first field and remove ... dups from. ... perldoc DBI ...
    (comp.lang.perl.misc)
  • Re: Event-based databases
    ... sort type indicates whether it is word for word, letter for letter, numbers ... a web site I update at times; this is a MySQL table create statement. ... KEY `sortdate` ... Somewhere I've got a copy of MySQL, but I never learnt how to use it. ...
    (soc.genealogy.computing)
  • Re: The best elegant solution to override 65k rows limit in a sheet
    ... >select is about 100 times more powerful than spreadsheets. ... 5 point moving averages from a table ... in which the first field is observation number and the second field is ... What sort of gyrations does something this simple require in a SELECT ...
    (microsoft.public.excel)