-2

I am looking for a solution concerning SQL Query for Oracle DB what returns DISTINCT full objects from many columns e.g:

SELECT DISTINCT mt.column1, mt.column2, mt.column3 FROM MyTable mt;

But I need full objects like SELECT * FROM MyTable

Is there any way to obtain such effect using usual SQL statements?

Thanks in advance! :)

Raging Bull
  • 18,593
  • 13
  • 50
  • 55
Rafcik
  • 362
  • 7
  • 18

1 Answers1

1

I think you are looking for a query like this:

SELECT *
FROM (
    SELECT 
        *, ROW_NUMBER() OVER (PARTITION BY mt.column1, mt.column2, mt.column3 ORDER BY mt.column1, mt.column2, mt.column3) As Seq
    FROM 
        MyTable mt) AS DT
WHERE
    Seq = 1;
shA.t
  • 16,580
  • 5
  • 54
  • 111
  • 1
    [I think not](http://stackoverflow.com/q/11206498/4519059) and you need to do it in other way ;). – shA.t Jun 09 '15 at 07:36