one of the column in my table contains the data like
SAL
----
1000
1000
2000
3000
3000

So my requirement is i want output like
SAL
---
1000
2000
3000

it mean i want to delete duplicate rows in the table
permanently and i want output in the above formatow should u
write query?

Answer Posted / abin

Select sal from (Select *,ROW_NUMBER() over (partition by
sal order by sal asc)num from emp) a
Where num=1

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is secondary key?

685


what are the different functions in sorting an array? : Sql dba

773


Why should I use postgresql?

778


what are myisam tables? : Sql dba

734


Is sql scripting language?

739


What are the types of sql commands?

762


How do you run a query?

777


how many sql dml commands are supported by 'mysql'? : Sql dba

806


what is datawarehouse? : Sql dba

766


How to start the command-line sql*plus?

759


What is trigger in sql? Explain

716


What are all different types of collation sensitivity?

758


What is cte sql?

727


What is consistency?

895


What is sql table?

700