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
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
- 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
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
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
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
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
-
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
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