jayankurian

Why SQL Query imports ONLY ONE record from SQL DB and duplicate the same record infinite?

Discussion created by jayankurian on Feb 23, 2017
Latest reply on Mar 8, 2017 by jayankurian

Hello SQL Gurus

My first attempt to tap into a SQL DB using the following SQL statement. Very basic statement...

 

The Query imports one record and duplicate the same record infinitely..

Not sure why this Query is not seeing my "WHERE" statement.

 

Please HELP.....

 

Thank you

=====================================================================================================

SELECT "ExplorerSnapshot"."Accession", "ExplorerSnapshot"."DOB", "ExplorerSnapshot"."DictatorFirstName", "ExplorerSnapshot"."DictatorLastName", "ExplorerSnapshot"."IsSTAT", "ExplorerSnapshot"."LastModified", "ExplorerSnapshot"."LastPrelimDate", "ExplorerSnapshot"."LastSignDate", "ExplorerSnapshot"."PatientAge", "ExplorerSnapshot"."OrderCreateDate", "ExplorerSnapshot"."OrderDate", "ExplorerSnapshot"."PatientMRN", "ExplorerSnapshot"."ProcedureDesc", "ExplorerSnapshot"."Procedures", "ExplorerSnapshot"."Sex", "ExplorerSnapshot"."ReportStatus", "ExplorerSnapshot"."SignerFirstName", "ExplorerSnapshot"."SignerLastName", "Report"."FirstCorrectedDate", "Report"."LastCorrectedDate", "Visit"."PatientType", "Visit"."VisitNumber", "CustomFieldChoice"."Label", "Site"."Name"

FROM "ExplorerSnapshot", "Report", "Visit", "CustomFieldChoice", "Site"

WHERE "ExplorerSnapshot"."LastModified" > '2017-01-24 03:03:45'

         AND "ExplorerSnapshot"."LastModified" < '2017-01-25 23:59:45'

    AND "Site"."Name" = N'Kings'

ORDER BY "ExplorerSnapshot"."LastModified"

====================================================================================================

OUTPUT (this same record has been duplicated more than 10,400 times with 3 seconds)

Outcomes