Ask Your Question
0

How to find unique values by using two column combined like sql GROUP BY query

asked 2017-09-11 07:29:21 +0200

I have two column like this:

id x_id data
1 11    abc
1 11    abc
1 12   vbn
2 11  abc
2  11 abc

I want to find unique values like this

1 11 abc
1 12 vbn
2 11 abc

In my case col a and b are the key . I want to find unique values by using two column combined which I can do by using sql

SELECT * FROM table group by a,b

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2017-09-11 10:52:00 +0200

Regina gravatar image

updated 2017-09-11 10:55:04 +0200

Assign a name to the entire data range in Data > Define Range. Thereby open the Options and check the needed options, likely Contains column labels and Insert or delete cells. That way you can use a named filter and do not conflict with other filters.

After the range is named, select it, e.g. by Data > Select Range. Then use Data > More Filters > Standard Filters. Use the Condition = and the value Not Empty for those columns, which should become duplicate-free, connect with operator AND. That way, the condition should be always true. (I assume, that you do not have empty cells in the range.)

Open the Options and check No duplications and in Copy results to you enter the address of the top,left cell of the target range for the duplicate-free data. OK. You need to copy the data, because otherwise only the rows containing duplicates are hidden.

If your source data has changes you can update the duplicate-free data by selecting the source range and then using Data> Refresh Range.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-09-11 07:29:21 +0200

Seen: 173 times

Last updated: Sep 11 '17