skip to Main Content

Table

a b
aa one
aa one
bb two
bb two
cc three

select distinct

a b
aa one
bb two
cc three

What query to write that there are only "three"?

2

Answers


  1. Does the following provide the expected result?

    select a, b
    from t
    group by a, b
    having count(*) = 1;
    
    Login or Signup to reply.
  2. SELECT
       DISTINCT a, b
    FROM
       table;
    

    I think this will result in what you need, yet the question is unclear. If this query does not solve your issue please clarify more what you need.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search