# Query.jl - how to select identical rows differing by one column

**URL:** <https://discourse.julialang.org/t/query-jl-how-to-select-identical-rows-differing-by-one-column/19367>\
**Category:** Data\
**Created:** [January 7, 2019, 9:26pm UTC](https://discourse.julialang.org/t/query-jl-how-to-select-identical-rows-differing-by-one-column/19367 "2019-01-07T21:26:52Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [January 8, 2019, 1:17am UTC](https://discourse.julialang.org/t/query-jl-how-to-select-identical-rows-differing-by-one-column/19367/7 "2019-01-08T01:17:28Z")

</div>

This should do it:

```julia
df |>
  @groupby({_.A,_.B,_.C}) |>
  @filter(length(_)>1) |> 
  @mapmany(_, (i,j)->j) |>
  DataFrame

```

First we group things, then we filter out the groups that have only one element, then we unpack the groups again to go back to a table.

I think I should really add a more convenient way to ungroup tables… `@mapmany(_, (i,j)->j)` does work, but is a bit unwieldy and hard to remember…

---

_[View the full topic](https://discourse.julialang.org/t/query-jl-how-to-select-identical-rows-differing-by-one-column/19367)._
