Re: Very confused with query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This one works, just change the fields...

SELECT transaction_user_id, Max(transaction_date) AS transaction_max_date, *
FROM transactions group by transaction_user_id;

This works... but I tried it on a number field instead of date... but it
should handle the same way...

Ronald Villarosa
www.pabahay.com
www.bullsandbears.net
www.2datop.com


"Sparky Kopetzky" <sparkyk@blackmesa-isp.net> wrote in message
000801c34311$3c087c80$82dbfcd0@blackmesaisp.net">news:000801c34311$3c087c80$82dbfcd0@blackmesaisp.net...
Good morning!!

I'm trying to select 1 and only one record from each user based on the last
date from a transaction file. This is what I'm using and it's not even
close. It seems DISTINCT does not work!!

SELECT DISCTINCT(transaction_user_id), MAX(transaction_date), * FROM
transaction;

Could some kind soul help me figure this one out??

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux