L
L
Light7772015-05-25 07:50:04
Oracle
Light777, 2015-05-25 07:50:04

What select to execute?

What select to execute so that only a distinct id with its value comes out, no matter what value
ID VALUE
1 qq
1 qq
1 ghgh
4 cvx
2 wqe
2 gf
2 bb
3 df
3 sad

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
Light 777, 2015-05-25
@Light777

select max(VALUE), ID from TABLENAME group by ID

I
ivankomolin, 2015-05-25
@ivankomolin

SELECT 
  id, value
FROM {{TABLE}}
GROUP BY id

V
Viktor Korzunin, 2015-05-25
@F1oyd

SELECT ID, First(`VALUE`) FROM `table` GROUP BY ID;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question