2016.01.04 04:55 PM
2016.01.05 12:38 AM
Something like this?
select by xxx from reverse table
Kim
Von: personal-kdbplus@googlegroups.com [mailto:personal-kdbplus@googlegroups.com] Im Auftrag von Carfield Yim
Gesendet: Dienstag, 5. Januar 2016 01:55
An: Kdb+ Personal Developers
Betreff: [personal kdb+] Get first row from a group
Hi, if I like to select the last row from a group, I can just do
select by xxx from table
if there similar syntax to select the first row? Other than using "first" for all elements?
--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbplus+unsubscribe@googlegroups.com.
To post to this group, send email to personal-kdbplus@googlegroups.com.
Visit this group at https://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.
2016.01.06 08:15 AM
2016.01.06 01:43 PM
2016.01.06 02:04 PM
What's wrong with
select from table where i=(first;i) fby keycol
Just have to be careful of using "i" with partitioned tables.
Also, the above can be easily changed to grab last, or first 2 rows per key etc. And can be used for multiple keys
select from table where i=(first;i) fby ([]keycol1;keycol2)
2016.01.10 04:42 PM
2016.01.06 09:11 AM
2016.01.07 06:56 AM
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.