Results 1 to 2 of 2

Thread: Help in query

  1. #1
    Join Date
    Jul 2013

    Thumbs up Unanswered: Help in query


    we have a data warehouse. One of the tables is a history table.
    See attachment

    The history key is just to unify a row.
    The apparaat-key means that al these rows belong to one apparaat.
    In this example there is just one apparaat, in the table there are hundreds different ones.
    vanaf- and tot-en-met-datum are the date boundaries for every change on apparaat.
    recent-ind means that this is the most recent record.

    The first set of four lines is correct.
    The second and third set of four lines have a mistake.
    The dates are not completely correct. There are gaps.
    In the second set there is a gap between the tot-en-met-datum of row 2 and the vanaf-datum of row three.
    There is also a gap in the third set.

    Is it possible to write one query to check if there are gaps in the dates for each and every apparaat? The result of the query must be the apparaten where mistakes are found.

    Attached Thumbnails Attached Thumbnails map111.jpg  

  2. #2
    Join Date
    Jul 2016
    Provided Answers: 1

    quick and dirty

    Hi deebeetwee,

    if you post the DDL for this table

    and the inserts for the test data,

    someone might try to help.

    Good luck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts