select MyId,COUNT(1) from #MyTable
group by MyId
having COUNT(1) > 1
--Select duplicate records
with CTE
AS
(SELECT MyId, RANK() OVER (PARTITION BY MyId ORDER BY num) rnk
FROM(SELECT *, ROW_NUMBER() OVER(ORDER BY MyId) num
FROM #MyTable
) X
)
Select * from CTE
WHERE rnk > 1
--Delete Duplicate records
with CTE
AS
(SELECT MyId, RANK() OVER (PARTITION BY MyId ORDER BY num) rnk
FROM(SELECT *, ROW_NUMBER() OVER(ORDER BY MyId) num
FROM #MyTable
) X
)
delete from CTE
WHERE rnk > 1
Friday, October 16, 2009
Tuesday, October 6, 2009
good article to study in abrod
http://getahead.rediff.com/report/2009/oct/06/career-study-us-makes-more-sense-today.htm
Thursday, October 1, 2009
World's top 10 mobile - 2009
http://business.rediff.com/slide-show/2009/oct/01/slide-show-1-tech-top-10-mobile-phones.htm
Wednesday, September 30, 2009
Tuesday, September 29, 2009
What is dual listing -- Good article ADR/GDR
http://business.rediff.com/report/2009/sep/29/perfin-what-is-dual-listing-and-why-india-may-not-adopt-it.htm
Sunday, September 27, 2009
look young
Anyone who stops learning is old, whether at twenty or eighty. Anyone who keeps learning stays young. The greatest thing in life is to keep your mind young.
Saturday, September 26, 2009
Silverlight tutorials
http://www.davidezordan.net/blog/?p=1436
http://www.smartwebcontrols.com/video/
http://www.smartwebcontrols.com/video/
Subscribe to:
Posts (Atom)