How to delete same emp id in sql query for exmaple in emp
table emp id, empname, emp address. for example emp id =5,
repeated in two times in rows same id how to delete same
empid please any one of the write query send in my id

Answers were Sorted based on User's Feedback



How to delete same emp id in sql query for exmaple in emp table emp id, empname, emp address. for ..

Answer / akshita

delete from emp where rowid not in (select max(rowid) from
emp group by empno)

Is This Answer Correct ?    11 Yes 3 No

How to delete same emp id in sql query for exmaple in emp table emp id, empname, emp address. for ..

Answer / mail2sentha

DELETE FROM EMP WHERE ROWID NOT IN(SELECT MIN(ROWID)FROM
EMP GROUP BY EMPID);

Is This Answer Correct ?    6 Yes 0 No

How to delete same emp id in sql query for exmaple in emp table emp id, empname, emp address. for ..

Answer / rohit kumar

Delete from employee where (empid,empname) notin (select min
(empid),empname from employee group by enmpname);

Is This Answer Correct ?    2 Yes 1 No

How to delete same emp id in sql query for exmaple in emp table emp id, empname, emp address. for ..

Answer / ajit

DELETE FROM EMP WHERE EMPID= 5 AND ROWNUM < 2;

Is This Answer Correct ?    0 Yes 0 No

How to delete same emp id in sql query for exmaple in emp table emp id, empname, emp address. for ..

Answer / guest

u can delete by slelcting the rowid of that particular
record

Is This Answer Correct ?    3 Yes 4 No

How to delete same emp id in sql query for exmaple in emp table emp id, empname, emp address. for ..

Answer / his highness yadav

ur question is not much clear

is it to delete duplicate rows or

to delete all the rows which is repeating , and the original

fr the first the query above will work fine

second option try this

delete from emp a, emp b where a.empno=b.empno

i think this will go ,, this will delete the all records which
is duplicating


cheers

Is This Answer Correct ?    1 Yes 4 No

How to delete same emp id in sql query for exmaple in emp table emp id, empname, emp address. for ..

Answer / prajyot

Hi,

You can use the below mentioned query ....

SELECT ROWID( Emp_id ) FROM EMP WHERE Emp_id = 5;

Praj

Is This Answer Correct ?    1 Yes 5 No

How to delete same emp id in sql query for exmaple in emp table emp id, empname, emp address. for ..

Answer / vijay

Delete from emp where empid=5;

Is This Answer Correct ?    4 Yes 10 No

Post New Answer

More SQL PLSQL Interview Questions

what is a database? : Sql dba

0 Answers  


Can we enter data in a table in design view?

0 Answers  


What are the different ways to optimize a sql query?

0 Answers  


hi sql gurus, here is my question 4 u. i wanna use triggers for sending reminder mail to all users who are registered to the site. if any one knws the code plz send me ans here : chayabs3@gmail.com thnx advance

1 Answers  


how do you login to mysql using unix shell? : Sql dba

0 Answers  






what are the 'mysql' command line options? : Sql dba

0 Answers  


can a stored procedure call itself or recursive stored procedure? : Sql dba

0 Answers  


how to retrieve only duplicate values in a table

9 Answers  


Can we debug stored procedure?

0 Answers  


Is ms sql traffic encrypted?

0 Answers  


what is the difference between pragma exception_init and raise_application_error

1 Answers   Aetins, State Street,


What is spool?

0 Answers  


Categories