Display 1st row of every group?

2005-04-11 Thread Dan Bolser
I read with great interest this http://www.artfulsoftware.com/queries.php#4 Display 1st row of every group SELECT id FROM tbl GROUP BY id HAVING count(*) = 1; I want to use this syntax with an 'order by' like this... SELECT * FROM tbl GROUP BY id HAVING count(*) = 1 ORDER BY bleah

Re: Display 1st row of every group?

2005-04-11 Thread Dan Bolser
a unique minimum value per id group. On Mon, 11 Apr 2005, Dan Bolser wrote: I read with great interest this http://www.artfulsoftware.com/queries.php#4 Display 1st row of every group SELECT id FROM tbl GROUP BY id HAVING count(*) = 1; I want to use this syntax with an 'order by' like

Re: Display 1st row of every group?

2005-04-11 Thread Rhino
- Original Message - From: Dan Bolser [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Monday, April 11, 2005 5:58 AM Subject: Display 1st row of every group? I read with great interest this http://www.artfulsoftware.com/queries.php#4 Display 1st row of every group SELECT id

Re: Display 1st row of every group?

2005-04-11 Thread Dan Bolser
On Mon, 11 Apr 2005, Rhino wrote: - Original Message - From: Dan Bolser [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Monday, April 11, 2005 5:58 AM Subject: Display 1st row of every group? I read with great interest this http://www.artfulsoftware.com/queries.php#4 Display

Re: Display 1st row of every group?

2005-04-11 Thread Peter Brawley
Dan Bolser wrote: I read with great interest this http://www.artfulsoftware.com/queries.php#4 Display 1st row of every group SELECT id FROM tbl GROUP BY id HAVING count(*) = 1; I want to use this syntax with an 'order by' like this... SELECT * FROM tbl GROUP BY

Re: Display 1st row of every group?

2005-04-11 Thread Dan Bolser
On Mon, 11 Apr 2005, Peter Brawley wrote: /I guess that entry is either wrong or misleading./ Ordering by another column which isn't mutually dependent with the grouping column will have unpredictable results. Is that what you mean by the example being wrong or misleading? No, I mean the

Re: Display 1st row of every group?

2005-04-11 Thread Peter Brawley
hino wrote: - Original Message - From: "Dan Bolser" [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Monday, April 11, 2005 5:58 AM Subject: Display 1st row of every group? I read with great interest this http://www.artfulsoftware.com/queries.ph

Re: Display 1st row of every group?

2005-04-11 Thread Dan Bolser
- Dan Bolser wrote: On Mon, 11 Apr 2005, Rhino wrote: - Original Message - From: Dan Bolser [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Monday, April 11, 2005 5:58 AM Subject: Display 1st row of every group? I read with great interest this http

Re: Display 1st row of every group?

2005-04-11 Thread Peter Brawley
Mon, 11 Apr 2005, Rhino wrote: - Original Message - From: "Dan Bolser" [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Monday, April 11, 2005 5:58 AM Subject: Display 1st row of every group? I read with great interest this http://www.artfulsoftware.com