Is it possible to filter a SQLite query so that each value appears only once in each column -
select * mytable | b ---+---- 1 | 2 2 | 10 2 | 5 3 | 10
i want each number appear 1 time in each column, i.e. result should be:
a | b ---+---- 1 | 2 2 | 10
is possible?
i suggest add together column id. this:
select a, b mytable m1 not in (select m2.a mytable m2 m2.id < m1.id) , b not in (select m3.b mytable m3 m3.id < m1.id)
if don't want decide order of ids, can add together column (like sequence).
sqlite
No comments:
Post a Comment