RE: query help
Posted in 2000
Man, the weird questions you guys come up with.
If I understand it, you want something like this:
SELECT a.primary_key, a.row1 = b.row1 comp1, a.row2 = b.row2 comp2, a.row3 =b.row3 comp3, . . .
FROM table a, table b
WHERE a.primary_key != b.primary_key
INTO TEMP xtmp;
then choose the key from the temp table based on having 3 't's in the comp
columns
It would simplify things if DECODE recognized a Boolean expression, i.e.,
DECODE(a.col1 = b.col1, 't', 1, 'f', 0), but Informix finds consistency to
be such a bore. Alternatively, you could write stored procedures to do the
equality comparison and return a 1 or 0, then sum the results -- a little
easier
to understand, maybe.
> -----Original Message-----
> From: Jason [SMTP:jasong@paradise.net.nz]
> Sent: Thursday, April 20, 2000 4:40 AM
> To: informix-list@iiug.org
> Subject: query help
>
> Hello,
>
> how can I return all occurrences of rows that occur more than once in a
> table if they have the same values in 3 columns???
>
> example,
>
> row 1 and 3 match in columns 2,3 and 4
>
> aaa|bbb|ccc|ddd|eee <-return this
> bbb|eee|fff|ggg|hhh
> fff|bbb|ccc|ddd|jjj <-return this also
>
> Thanks in advance,
> Jason