MySQL Forums
Forum List  »  General

Re: Help with a SQL statement
Posted by: Peter Brawley
Date: February 23, 2017 07:23PM

Is this what you mean?

select a.serial, b.tag, a.theunit
from (
  select serial, min(unit) as theunit
  from tbl
  group by serial
) as a
join tbl as b on a.serial=b.serial and a.theunit=b.unit ;



Edited 1 time(s). Last edit at 02/23/2017 07:24PM by Peter Brawley.

Options: ReplyQuote


Subject
Written By
Posted
February 23, 2017 07:15PM
Re: Help with a SQL statement
February 23, 2017 07:23PM
February 23, 2017 09:42PM
February 23, 2017 09:42PM


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.