0

I am trying to create a self-executing Pervasive SQL (PSQL) view command that can preemptively remove duplicate rows from a table on-the-fly. The basic command to create a single column table view is as follows:

 CREATE VIEW "VIEW_EMP" AS SELECT "ATTENDANCE" . "EMPLOYEE" FROM "TIME_ATTENDANCE" 

I am wondering if anyone has any ideas how to implement any means of avoiding duplicate appends of the EMPLOYEE field? As you can see above, the name of the source table is ATTENDANCE and the name of the destination table (view) will be VIEW_EMP.

I've found that PSQL is very similar to MySQL so even if you don't know PSQL perhaps you can still answer this question. I found this post using the MySQL DELETE command, but I don't know if it is applicable in my particular case.

Community
  • 1
  • 1
Jim22150
  • 511
  • 2
  • 8
  • 22

1 Answers1

1

In most versions of SQL you would use

SELECT DISTINCT ATTENDANCE.EMPLOYEE
FROM TIME_ATTENDANCE 

or

SELECT ATTENDANCE.EMPLOYEE 
FROM TIME_ATTENDANCE 
GROUP BY EMPLOYEE

Did you try one of these?

Hogan
  • 69,564
  • 10
  • 76
  • 117