Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my table has duplicate rows I want to detect the duplicate rows how to get it

For example my table has following
SeqNo     Date         Desc                Amount      Debit     Credit 
2       07/12/2012   PurchaseReturn(CR)    12000       0          12000
2       07/12/2012   PurchaseReturn(CR)    12000       0          12000
2       07/12/2012   Cash A/C(DR)          12000       12000       0


In the above 1st and 2nd Rows are Same. So I want get only one row

How to do it please help me

Thank you
Posted
Updated 17-Jul-12 21:24pm
v2

SQL
select distinct * from your_tablename


Try it................
 
Share this answer
 
v4
hi
check this, for basic understanding on "Distinct" in SQL

http://www.w3schools.com/sql/sql_distinct.asp[^]
 
Share this answer
 
hello,

you can get either way...
SQL
select prefix from userlist group by prefix
select distinct prefix from userlist


May be this right what you want.
 
Share this answer
 
select distinct(desc) from etc........
 
Share this answer
 
select Desc ,count( Desc ) from tbitemgroup group by Desc
having count( Desc ) >1

this will help you to get how many times ur value in desc column is repeating
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900