sqlfire - Why won't this statement work? SQL -
i using sqlfire. doing assignment , when beginning assignment came across couldn't return particular value. see sql fiddle, contains exact data in table using in assignment , contains sql statement have tried. fiddle: http://sqlfiddle.com/#!2/e761ac/1
what want outputted is:
rate | rentalcode ----------------- 350 | wl
i getting error when type code sql fire.
i have been told not use order clause , have not learnt 'limit'
thank you
you need have group by
clause since have non-aggregated column in select
clause
select min(rate), rentalcode rentalrates group rentalcode
update
since want lowest rate, think better way using order - limit
since supports multiple records having lowest rate.
select * rentalrates rate = (select min(rate) rentalrates)
Comments
Post a Comment