hi, sorry, partition by event somehow?  i'm not seeing it  :/

On Wed, Jul 15, 2015 at 6:52 PM, Ying Zhang <Y.Zhang@cwi.nl> wrote:
Opes, I see.  I’m sorry.  Then LIMIT 1 is not what you need.  MonetDB doesn’t have anything directly assemble TOP 1.

Your use case sounds a bit similar to another use case on the mailing list, about computing the OHLC chart.
It’s a bit too late to think of the exact query, but how about using PARTION BY, then ROWNUMBER, en select the row with number 0 (or is 1 the starting value?)?

> On Jul 16, 2015, at 00:27 , Anthony Damico <ajdamico@gmail.com> wrote:
>
> hi Jennie, thanks for spending time on this!  won't LIMIT only give one record?  i need one record per event..  so i think the "insert into" command would need to be repeatedly called until every single event got stored (which would take forever)?  sorry if i'm missing something
>
> On Wed, Jul 15, 2015 at 6:20 PM, Ying Zhang <Y.Zhang@cwi.nl> wrote:
> Maybe I’m thinking in a too simple way, but if you store the intermediate results in a table, you can use LIMIT 1:
>
> CREATE TABLE t1 (svcmon int); -- assume svcmon is an INT
> insert into t1
>   SELECT svcmon
>   FROM person_table AS z
>   WHERE a.yr = z.yr AND a.person_id = z.person_id
>   ORDER BY abs( z.svcmon - a.svcmon )
>   LIMIT 1;
>
> Using TEMP TABLE might give you a bit speed up, but then you need to put them in one transaction.
>
> Jennie
>
> > On Jun 13, 2015, at 07:47 , Anthony Damico <ajdamico@gmail.com> wrote:
> >
> > any ideas on this?  thanks!
> >
> > On Thu, Jun 4, 2015 at 7:39 AM, Anthony Damico <ajdamico@gmail.com> wrote:
> > https://stackoverflow.com/questions/30641876/monetdb-sql-method-to-locate-or-match-by-the-nearest-value-without-a-top-or-lim
> >
> > i'm thinking i can do this with some costly self-join, but i'd appreciate any other eyes on the problem
> >
> > _______________________________________________
> > users-list mailing list
> > users-list@monetdb.org
> > https://www.monetdb.org/mailman/listinfo/users-list
>
> _______________________________________________
> users-list mailing list
> users-list@monetdb.org
> https://www.monetdb.org/mailman/listinfo/users-list
>
> _______________________________________________
> users-list mailing list
> users-list@monetdb.org
> https://www.monetdb.org/mailman/listinfo/users-list

_______________________________________________
users-list mailing list
users-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/users-list