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?

Answers were Sorted based on User's Feedback



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

Answer / dinesh kumar

delete from table_name alias1
where rownum < ( select max(rownum) from table_name alias2
where alias1.col1 = alias.col2 );

Is This Answer Correct ?    0 Yes 0 No

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

Answer / destiny

create table salary2 as select distinct * from salary1
drop table salary1
rename salary2 to salary1

Is This Answer Correct ?    0 Yes 0 No

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

Answer / muthukumar

Select Sal From Emp
Group By Sal

Is This Answer Correct ?    3 Yes 4 No

Post New Answer

More SQL PLSQL Interview Questions

what is a trigger? : Sql dba

0 Answers  


GLOBAL TEMPORARY TABLE over Views in advantages insolving mutating error?

0 Answers   Virtusa,


What are the two parts of a procedure ?

6 Answers   Hi Caliber IT,


Suppose There is a string A.B....C.......D.........E........F In this string dots (.) are not having fixed count in between of string. I want the output to have string with one dot between. I.e. A.B.C.D.E.F

6 Answers   IBM,


What is the difference between row level and statement level trigger?

0 Answers  






What does pragma mean?

0 Answers  


What is dba in sql? : SQL DBA

0 Answers  


How many postgresql users are there, worldwide?

0 Answers  


If we have n no of columns in a table, can we add new column in that table with not null constraint?

2 Answers  


What is memory optimized?

0 Answers  


What is the default isolation level in sql server? : Transact sql

0 Answers  


what is the stuff function and how does it differ from the replace function? : Sql dba

0 Answers  


Categories