I think this is what you want - note the change in the very last clause:
select localSymbol, max(localDate2)
from trendtim_trendtimer.tre_xignite
where localDate2<'2013-07-02'
group by localSymbol
order by max(localdate2)
On 2013-07-03 06:51, TrendTimer.com wrote:
select localSymbol, max(localDate2) from
trendtim_trendtimer.tre_xignite where localDate2<'2013-07-02' group by
localSymbol
order by localdate2
I was expecting the following error:
Column "LOCALDATE2" must be in the GROUP BY list; SQL statement:
<http://192.168.1.9:8082/query.do?jsessionid=b5b3a79c0bdff34315ffa813d83b2fe4#>
I do see this error when using H2 and I understand that this is the
normal behavior for many databases. The question is:
Does anyone know how I can accomplish the same result in H2?
I tried:
select localSymbol, localDate2 from tre_xignite a
where localDate2 in (select max(localDate2) from tre_xignite b where
a.localSymbol=b.localSymbol)
But this doesn't seem to work.. at least not quickly. I cancelled it
after 30 seconds. I'd appreciate any help! Thanks
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.