Tags: , | Categories: Oracle Posted on 12/28/2009 2:04 PM | Comments (0)

Think you have a table like this:

 

Employee No

Attendance Date

In Time

A0001

01-DEC-2009

08.00 AM

A0002

01-DEC-2009

08.30 AM

A0001

01-DEC-2009

08.20 AM

A0002

01-DEC-2009

08.40 AM

A0003

01-DEC-2009

08.40 AM


In this table employee no A0001 and A0002 comes twice in same attendance date. Now you think that you need to remove the duplicate date from that table. But how will you do it?


The solution is rowid.


A rowid is a pseudo column (like versions_xid), that uniquely identifies a row within a table. Like:

 

Rowid

Employee No

Attendance Date

In Time

1

A0001

01-DEC-2009

08.00 AM

2

A0002

01-DEC-2009

08.30 AM

3

A0001

01-DEC-2009

08.20 AM

4

A0002

01-DEC-2009

08.40 AM

5

A0003

01-DEC-2009

08.40 AM


Now using this rowid you can easily remove the duplicate data.


See the following code:


   1: Delete FROM Attendance_Details 
   2: WHERE rowid not in 
   3: (SELECT MIN(rowid) FROM attendance_details 
   4: GROUP BY att_date,empno);


First understand what inner query do:


   1: SELECT MIN(rowid) FROM attendance_details 
   2: GROUP BY att_date,empno; 


It will find out the single row of same employee’s same day attendance though minimum row id. Like:

 

Rowid

Employee No

Attendance Date

In Time

1

A0001

01-DEC-2009

08.00 AM

2

A0002

01-DEC-2009

08.30 AM

5

A0003

01-DEC-2009

08.40 AM


From above data you can easily understand that, employee no A0001 at 01-DEC-2009 minimum row no is 1. Same things happens with other employees also.


Now check the delete command.


   1: delete FROM attendance_details 
   2: WHERE rowid not in 
   3: (SELECT MIN(rowid) 
   4: FROM attendance_details 
   5: GROUP BY att_date,empno) ;


Now delete command delete only those rows that will not come in inner query. That means following rows will be deleted:

 

Rowid

Employee No

Attendance Date

In Time

2

A0002

01-DEC-2009

08.30 AM

4

A0002

01-DEC-2009

08.40 AM


I will post another blog where I will give you solution for deleting the duplicate row in SQL server.

Tags: | Categories: ASP.NET Posted on 8/12/2009 8:49 AM | Comments (1)

See the error message!!!

Why this error comes:

CrystalDecisions.CrystalReports.Engine assembly is not found in specified server.

My server current configuration:

  • Windows 2003 
  • IIS6

Main thing is that, I didn't install visual studio in specified server. When we install visual studio, in that time it install crystal report related all files into PC.

How I Resolve this error:

If you have the visual studio DVD. Then go to 'WCU\Crystal Reports' folder. You will get a executable file called CrystalReports2007.msi. Just install that file into specified server.

That's all.

Is There any better option?

if you know any better option to solve this problem, please let me know.

 

 

Tags: | Categories: Personal Posted on 6/25/2009 5:38 AM | Comments (5)

Introduction

Last years I started my blog site at wordpress. Its name was sadeque.wordpress.com. Write few blogs over there. But few months ago I found the asp.net based blogging engine blogengine.net. Then I think that it will be better to do a blogging site with blogengine.net, where I can share my knowledge as well as work on this blog engine.

Who am I?

It’s me Sadeque Sharif. I love to work with asp.net. Currently working with asp.net for web based enterprise solution. Now giving concentration on LINQ and ASP.NET MVC.

What will be in this blog site?

This blog site will be totally ASP.NET based. I will try to write all my blogs based on ASP.NET. May be there will be some blogs which will be related with Microsoft products like: SQL Server.

Why crea8ivecode.net?

Crea8ive is nothing but creative. Creative means having the power to create. From my point of view crea8ivecode means having the power to create code. The code which will be different, useful and simple.

At last,

Starting with name of almighty Allah.