Re: Missing an answer to an topic (Finding gaps in db)
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 - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Missing an answer to an topic (Finding gaps in db)
Hi, If you wish to find NUMBERS which are missing, i think you can try this: set @a:=0;/*initialise variable a*/ select @a:=@a+1,IF(YOUR_COLUMN_INT_TYPE= @a,'OK',@a:= @a+1) FROM YOUR TABLE; Don't forget to initialise variable 'a' for every time when run the second query. This is work indeed but if you want to have a definitively solution i think you should to do an UDF where you can make some rules and conditions to checking what data is missing from the table field(column). Hope it's help Regards, Gelu _ G.NET SOFTWARE COMPANY Permanent e-mail address : [EMAIL PROTECTED] [EMAIL PROTECTED] - Original Message - From: Jan Broermann [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 10, 2002 6:01 AM Subject: Missing an answer to an topic (Finding gaps in db) 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) thx from Germany Jan - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Missing an answer to an topic (Finding gaps in db)
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. thx from Germany Jan - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Missing an answer to an topic (Finding gaps in db)
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) thx from Germany Jan - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Missing an answer to an topic (Finding gaps in db)
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) thx from Germany Jan - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php