kdb remove duplicate rows - Kdb+ / qStudio

Home Forums Kdb+ / qStudio kdb remove duplicate rows

This topic contains 1 reply, has 2 voices, and was last updated by  Ryan Hamilton 4 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #111070

    Michael

    How can I remove duplicate rows from a table in kdb?

    #111072

    distinct will return only those rows that are unique in a table. For example:

    `q)t:([] a:1 1 1 2 2 2; b:4 4 5 5 6 6)`

    q)t
    a b

    1 4
    1 4
    1 5
    2 5
    2 6
    2 6

    q)distinct t
    a b

    1 4
    1 5
    2 5
    2 6

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.