Peter Beckman wrote:
On Mon, 13 Nov 2006, [EMAIL PROTECTED] wrote:
Actually, that should not work, it should give you an error.
This should work:
SELECT `fkid`,max(`foo`) as foo,`bar` FROM `test2` GROUP BY `fkid`
ORDER BY `bar` ASC
Yes, but if the data is in a different order that fails a
On Mon, 13 Nov 2006, [EMAIL PROTECTED] wrote:
Actually, that should not work, it should give you an error.
This should work:
SELECT `fkid`,max(`foo`) as foo,`bar` FROM `test2` GROUP BY `fkid` ORDER BY
`bar` ASC
Yes, but if the data is in a different order that fails and doesn't maintain
r
Actually, that should not work, it should give you an error.
This should work:
SELECT `fkid`,max(`foo`) as foo,`bar` FROM `test2` GROUP BY `fkid` ORDER BY
`bar` ASC
Miguel Guirao wrote:
> select max(bar) from mytable where unique fkid order by bar asc
>
> as far as I remember!!
>
> -Ori
select max(bar) from mytable where unique fkid order by bar asc
as far as I remember!!
-Original Message-
From: Peter Beckman [mailto:[EMAIL PROTECTED]
Sent: Lunes, 13 de Noviembre de 2006 04:59 p.m.
To: PHP-DB Mailing List
Subject: [PHP-DB] MySQL SQL Query Help
I have a table:
id fk
Hi
Try:
SELECT fkid, MAX(foo), bar FROM table GROUP BY fkid ORDER BY bar DESC
Niel
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php