The answer is NO in sybase. In some dbmses you have an internal row id, other than the unique or primary keys. But it still is not a true answer to your question.
The simple fact, in order to delete, you need a unique SARG.
Well theres one...
If you really want it in ONE SQL, how about creating a stored proc and calling it... "sp_deleteduplicates". There you go thats ones command.
Another option is to create unique index with ignore_dup_rows, but again its not completely what you want.
Originally Posted by goraksh
How can a table have duplicate row if it has primary key in it.
i think you didnt get my question as yet. I need to solve it in a single SQL query.
Whilst your intentions might be innocent, such statements is considered rude in a way. Theres always more than one solution to any problem and the original poster advised you of one of the ways it can be done, considering the pickle you are in.
1. What you are asking looks like an interview question. Is it?
2. If its not, and if you are thinking about cleanup, you already lost some ground in data integrity and hence your application is in a soup. So, spend more time on how to fix the core problem than bandaiding