List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:September 10 2002 4:34pm
Subject:Re: Missing an answer to an topic (Finding gaps in db)
View as plain text  
At 4:54 +0200 9/10/02, Jan Broermann wrote:
>Hi,
>I'm missing an answer to a topic which came up a couple of days /weeks ago.
>For a database i'm administrating I would like to find out, which numbers
>(of invoices)
>are missing in our database. Is there a way to get this result set thru SQL?
>Or do I have to do it with for example Java?
>I think somebody else asked a question similar to my probleme, but I can't
>find
>an answer in my mails. I think it must be a construction of something like
>not in between [max]max(tab.invoice) and [min] min (tab,invoice) ????????


You need a reference table that lists all the invoice IDs in the range
that you want to check.  Then you can perform a left join of this table
against your invoice table to find non-matching records.

If you have no such reference, then you can select the IDs that do happen
to lie within the range, and apply some programming logic to figure out
which ones aren't there.

>
>thx from Germany
>Jan

Thread
Missing an answer to an topic (Finding gaps in db)Jan Broermann10 Sep
  • Re: Missing an answer to an topic (Finding gaps in db)Paul DuBois10 Sep
  • Re: Missing an answer to an topic (Finding gaps in db)Benjamin Pflugmann13 Sep
  • Re: Missing an answer to an topic (Finding gaps in db)Gelu Gogancea13 Sep
    • Re: Missing an answer to an topic (Finding gaps in db)Benjamin Pflugmann13 Sep
  • Re: Missing an answer to an topic (Finding gaps in db)Gelu Gogancea13 Sep
    • Re: Missing an answer to an topic (Finding gaps in db)Benjamin Pflugmann13 Sep