Re: differences

From: Mikito Harakiri <mikharakiri_at_yahoo.com>
Date: 31 Jan 2002 11:23:56 -0800
Message-ID: <bdf69bdf.0201311123.4b1af8d_at_posting.google.com>


brian-l-smith_at_uiowa.edu (Brian Smith) wrote in message news:<60360d48.0201310414.776f07bf_at_posting.google.com>...
> mikharakiri_at_yahoo.com (Mikito Harakiri) wrote in message news:<bdf69bdf.0201290944.45620dd_at_posting.google.com>...
>
> > what is a SQL query that returns all the differences between A and B?
> > It is important that position is used for ordering only, so that it is
> > pretty much like I'm comparing 2 text files. UNIX diff utility does
> > exactly that, but query must be superior, right?-)
>
> Do you expect the results to be the same as the results from UNIX
> diff?

I doublechecked diff source file, it's undoubtedly an heuristical comparison algorithm, so it can't be considered as a reference implementation.

> If you just want to know which lines are different, that isn't
> two bad. But diff actually gives you an output consisting of (a) lines
> added, (b) lines removed, and (c) lines that are consistent between
> the two inputs.

I'm not sure I undestand what you mean by "lines are different" in the first sentence. The question "if line #5 in file A is different from line #10 in file B" is too trivial to bother asking. The question "if there exists a matching line in file B for a line #5 in file A" is easy as well. The question "what line in file B matches line #5 in file A the best" is much harder. I expect a line number or null be the answer. If you are able to answer that question for all lines in file A and conversely for each line of file B so that there is no conflicting matches, you've got a solution I'm asking for. Received on Thu Jan 31 2002 - 20:23:56 CET

Original text of this message