ORDER BY time DESC only orders each series, and then SLIMIT returns only
one series. It doesn't necessarily return the series with the newest point.
Just remove the SLIMIT and use LIMIT 1.

Note that the LIMIT clause doesn't (yet) restrict the points queried. With
a "SELECT *" clause it's important to restrict the time range.

select * from blah where x='y' and time > now() - 6h group by base_date
order by time desc limit 1

On Tue, Oct 4, 2016 at 7:13 PM, Tanya Unterberger <
[email protected]> wrote:

> Hi Sean,
>
> That doesn't work as it still grabs the earliest base_date, not the
> latest...
>
> Thanks,
> Tanya
>
> On 4 October 2016 at 03:24, Sean Beckett <[email protected]> wrote:
>
>> Add ORDER BY time DESC
>> <https://docs.influxdata.com/influxdb/v1.0/query_language/data_exploration/#sort-query-returns-with-order-by-time-desc>
>> to the query
>>
>> On Sun, Oct 2, 2016 at 6:49 PM, <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> We have forecast data issued for the same period of time. It can be
>>> issued at various time points, which we keep as base_date tags. What is the
>>> easiest way to get the latest issued forecast? If you try to run something
>>> like "select * from blah where x='y' group by base_date slimit 1" the
>>> base_date is the earliest, not the latest.
>>>
>>> Thanks a lot,
>>> Tanya
>>>
>>> --
>>> Remember to include the InfluxDB version number with all issue reports
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "InfluxDB" 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 https://groups.google.com/group/influxdb.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/influxdb/f9f05733-bfdf-4637-900b-8e710ddfcd61%40googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Sean Beckett
>> Director of Support and Professional Services
>> InfluxDB
>>
>> --
>> Remember to include the InfluxDB version number with all issue reports
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "InfluxDB" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/influxdb/U-3Npsw6dZA/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/influxdb.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/influxdb/CALGqCvP%2B7BwvOaOkkz_3dPqVftT421N6vyHLTyMwZU0X
>> 184o6w%40mail.gmail.com
>> <https://groups.google.com/d/msgid/influxdb/CALGqCvP%2B7BwvOaOkkz_3dPqVftT421N6vyHLTyMwZU0X184o6w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> Remember to include the InfluxDB version number with all issue reports
> ---
> You received this message because you are subscribed to the Google Groups
> "InfluxDB" 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 https://groups.google.com/group/influxdb.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/influxdb/CAAHSRnAcc6fONx9-3eWqW3W06QUiBqVFKwLZv-j8bv-
> fmn1ZLg%40mail.gmail.com
> <https://groups.google.com/d/msgid/influxdb/CAAHSRnAcc6fONx9-3eWqW3W06QUiBqVFKwLZv-j8bv-fmn1ZLg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Sean Beckett
Director of Support and Professional Services
InfluxDB

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" 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 https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CALGqCvMKsFiQYhbfUZHTqPvV8FVaBVcvFbPr0oq2tP9PVCRtWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to