How about
 
select close_date, symbol, name 
from TD 
where symbol in (<list of 
characters>)  limit 1
ORDER BY close_date desc
 


Jeff Mathis <[EMAIL PROTECTED]> wrote:
hello query gurus.

we have a table TD with the following columns:

close_date
symbol
name

close_date is just a date field

there is a unique constraint on the combination of close_date and symbol.

what we want is the value for the name field corresponding to the row 
with the most recent close_date.

something like this:

select max(close_date), symbol, name from TD where symbol in (
characters>) group by symbol;

this returns the max close_date value, but the name that is returned is 
garbage and seems to point to the earliest row in the table.

any suggestions?

jeff

ps we're using mysql 4.1.3 with the innodb engine


-- 
Jeff Mathis, Ph.D. 505-955-1434
Prediction Company [EMAIL PROTECTED]
525 Camino de los Marquez, Ste 6 http://www.predict.com
Santa Fe, NM 87505


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



[EMAIL PROTECTED]
http://www.joeaudette.com
http://www.mojoportal.com

Reply via email to