Re: Need help with INFORMIX SQL problem
Posted in 1997
rich wrote: > > I need help writing SQL to a table that contains price information by month for > five years. I need to select the last posted price by month. Each month could > have one price or up to 20 prices. The output must contain the date and price. > > Rich Newell > > richn@northv.com Hmmm.... I haven't tried this but I think what you want will come freom a refinement of this: select month(posting_date) post_date, posted_price from post_table where year(today) - year(posting_date) <= 5 group by month(posting_date) -- -- Jake (Lost in thought and won't ask for directions) . . _..-'( )`-.._ ./'. '||\\\\. }\\_/{ .//||` .`\\. ./'.|'.'||||\\\\|.. )o o( ..|//||||`.`|.`\\. ./'..|'.|| |||||\\`````` \\,@,/ ''''''/||||| ||.`|..`\\. ./'.||'.|||| ||||||||||||. ||| .|||||||||||| ||||.`||.`\\. /'|||'.|||||| ||||||||||||{ | }|||||||||||| ||||||.`|||`\\ '.|||'.||||||| ||||||||||||{ | }|||||||||||| |||||||.`|||.` '.||| ||||||||| |/' ``\\||`` | ''||/'' `\\| ||||||||| |||.` |/' \\./' `\\./ \\!|\\ /|!/ \\./' `\\./ `\\| V V V }' `\\ /' `{ V V V \\ \\ \\ V / / / +-----------------------------------------------------------+ | Impeccable Logic: A thought process which successfully | | resists chicken bites | +-----------------------------------------------------------+