0

I am looking for help to write a query.
I have a database with an ID a Date_Field and a Description. I want to find out two things

What Date_Field and Description and Description are the same? {duplicate records}

SELECT *
FROM TIME_TABLE t1
WHERE EXISTS (
  SELECT * FROM TIME_TABLE t2 WHERE t2.DATE_FIELD=t1.DATE_FIELD AND
        t2.DESCRIPTION=t1.DESCRIPTION AND
        t2.RECORD_NUM<>t1.RECORD_NUM
        ORDER BY Date_field
  )

What row has an Identical Date_Field
{ Identical dates}

Select *
from TIME_TABLE t1
where exists (
  select * from TIME_TABLE t2 where t2.DATE_FIELD=t1.DATE_FIELD and
        t2.RECORD_NUM<>t1.RECORD_NUM
  )

Do these two queries look reasonable?
Thanks!

1
Contributor
1
Reply
4
Views
7 Years
Discussion Span
Last Post by rouse
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.