Alex, Thank you very much, I'll try all these this evening when back at home ! Best, Eric
Envoyé de mon BlackBerry - l'appareil mobile le plus sécurisé - via le réseau Orange Message original De: a...@software-lab.de Envoyé: 3 octobre 2019 08:25 À: picolisp@software-lab.de Répondre à: picolisp@software-lab.de Objet: Re: How to query the database? Hi Eric, > "(rel year (+Aux +Ref +Number) (week))" > makes a huge difference and works very well. > > as an example "(mapcar show (collect 'year '+Agenda (2019 32))" > > gives the whole week in a very very short query. Yes, and you can also query larger ranges, like (collect 'year '+Agenda (2019 32) (2019 40)) giving all days in weeks 32 through 40. > All these lead me to two more questions: > > 1) is it possible to have something more > than (week) in "(rel year (+Aux +Ref > +Number) (week))", '+Aux' combines any number of relations into an index (they must make sense, i.e. the resulting combined index key must be monotonuous). > for example, can I add the "monthnum"? It > could be nice to also have something like Basically, (rel year (+Aux +Ref +Number) (month week)) should be ok, as the week will not decrease with the month. However you cannot query then for just year plus week any longer, so it is probably not useful here. > "(collect 'year '+Agenda (2019 8))" in order > to get quickly the whole month "august" You could invent more complicated models, with redundancies like (rel month (+Ref +Bag) ((+Number)) # Year ((+Number)) ) # Month But I would not du that, as it complicates everything else. Normal combined 'select's should be fine. > 2) is there any way to sort the results of > "(collect 'year '+Agenda (2019 32))" by one > (or more) > key(s) of the database? Yes, e.g. (by '((This) (: key2)) sort (collect ...) ) or (by '((This) (cons (: key2) (: key3) (: key4)) sort (collect ...) ) ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe