sql works in libreoffice base but not libre basic -


i have classic question getting latest record table. here statement:

select t1.item, t1.price, t1.odate order t1 join ( (select item, price, max(odate) maxdate         order         group item ) t2 ) on t1.item = t2.item , t1.odate = maxdate order t1.item asc 

this statement works on both phpmyadmin , libreoffice base, libreoffice basic gives me message: syntax error in sql expression.

any help?

maybe should remove "price" t2's selection. seems nonsense in join, , cause error message below in mssms 2008 in case.

column 'order.price' invalid in select list because not contained in either aggregate function or group clause.

try

select t1.item, t1.price, t1.odate order t1 join  (select item, max(odate) maxdate         order         group item ) t2  on t1.item = t2.item , t1.odate = maxdate order t1.item asc 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -