Does select * from blah where x='y' and time > now() - 6h group by base_date order by time desc limit 1 slimit 1
return what you need? On Tue, Oct 4, 2016 at 8:59 PM, Tanya Unterberger < [email protected]> wrote: > Thanks, Sean. > > But it's not the data I am after. I am after the latest series, not the > latest point in each series. That's why I was using SLIMIT, but it returns > the earliest series, whereas I need the latest... > > Tanya > > On 5 October 2016 at 12:32, Sean Beckett <[email protected]> wrote: > >> 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/msgid/influxdb/f9f05733-bfdf-463 >>>>> 7-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/ms >>> gid/influxdb/CAAHSRnAcc6fONx9-3eWqW3W06QUiBqVFKwLZv-j8bv-fmn >>> 1ZLg%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 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/CALGqCvMKsFiQYhbfUZHTqPvV8FVaBVcvFbPr0oq2tP9PVC >> RtWw%40mail.gmail.com >> <https://groups.google.com/d/msgid/influxdb/CALGqCvMKsFiQYhbfUZHTqPvV8FVaBVcvFbPr0oq2tP9PVCRtWw%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/CAAHSRnDVJfvpEcFvnd4ajLD_HpEvJz%3D_8voWMt1DoU_hWptXMg% > 40mail.gmail.com > <https://groups.google.com/d/msgid/influxdb/CAAHSRnDVJfvpEcFvnd4ajLD_HpEvJz%3D_8voWMt1DoU_hWptXMg%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/CALGqCvNryecRcOTaE2D8JM-4WZhows0YDQZun4Bbpq4K7aJy%3DA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
