Subject | Re: [firebird-support] Simple Question? |
---|---|
Author | Lucas Franzen |
Post date | 2012-10-18T11:22:29Z |
Am 18.10.2012 12:57, schrieb Olaf Kluge:
SELECT FIRST 1 PREIS
FROM TSTAFFELPREISE where
TEILENR ='210094LG'
ORDER BY VANZ DESC
> Sorry,How about:
>
>
>
> where teilenr = a.teilenr of course…
>
>
>
>
>
> Hello everybody,
>
> today perhaps I have a simple question.
>
> In a table there are the following fields:
>
> Partnumber; quantity; price
>
> ABC; 1; 115€
>
> ABC; 10; 100€
>
> ABC; 20; 80€
>
> Now I would like one sql-query-result, the price for the greatest quantity.
>
> I have the following:
>
> SELECT PREIS
>
> FROM TSTAFFELPREISE a where
>
> TEILENR ='210094LG' and vanz = (select max(vanz) from tstaffelpreise where teilenr
SELECT FIRST 1 PREIS
FROM TSTAFFELPREISE where
TEILENR ='210094LG'
ORDER BY VANZ DESC