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
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 |
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 |
Types of backups ?
How do you delete duplicates in sql query using rowid?
What is the Query to print out the individual total number of duplicate row in sql.
Dear All, Question for this Week Find out possible error(s) (either at compile time or at runtime) in the following PL/SQL block. State the reason(s) and correct the errors. Declare Cursor C1 is select ename, sal, comm from emp; Begin For i in C1 Loop If i.comm between 299 and 999 then Dbms_output.put_line(i.Ename || ‘ ** Good Commission’); Elsif i.comm > 999 then Dbms_output.put_line(i.Empno || ‘ ** Very Good Commission’); close C1; Else Dbms_output.put_line(i.Ename || ‘ ** ’ ||nvl(i.comm,‘O’)); End if; End Loop; End;
how to saw triggers output in pl/sql database?
3. Select sum(a) sum_1,max(a) max_1 ,count(a) count_1 from ( ( select 1 a from dual union all Select to_number(‘2011’) a from dual union all select 1 a from dual) union select 2 b from dual);
What is indexing in sql and its types?
What is left join example?
Why do we use sql constraints?
Can we use the cursor's to create the collection in PL/SQL?
Can dml statements be used in pl/sql?
Is left join faster than inner join?