Responding to myself. I think I can do it like this:
select getprice('USD', 'CHF', #'2017-10-10') limit 1
On Tuesday, November 21, 2017 at 6:34:54 PM UTC+1, [email protected]
wrote:
>
> Hi,
>
> As I'm trying to interface with beancount only through bean-query, I'm
> wondering if I'm doing it right to retrieve a certain price at a certain
> date.
>
> To select a single price I'm doing this:
>
> select distinct getprice('USD', 'CHF', #'2017-10-10')
>
> This works but it looks like what's happening in the back is that it does
> the getprice call for each position and then only reduced it down to a
> single response because of the distinct (without the distinct I'm getting
> N-times the price.
> Is there something that I'm missing? Is there something similar to the
> oracle "select from dual" to avoid this?
>
> Thanks and Regards,
> Patrick
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Beancount" 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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beancount/96353148-228a-48b6-8b62-38d07596fcfa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.