0
I have an SQL table with hundreds of data, and I would like to introduce an array, the same be compared with this table and it is informed how many repetitions occurred. (Table --> EVENT | DADOS1 | DADOS2 | DADOS3 | DADOS4 | DADOS5 | DADOS6 | DADOS7 |DADOS8)
To be able to compare 2 events of this table to each other, but I want to compare 1 to the whole table and see the number of repetitions. For example, when comparing the 1247 event he will report that with 1 match (equal data in both, but all other different data) had 750 occurrences, 2 coincidences (data1 and data4 equal in both and different others - regardless of which data was equal to which, what matters and which had 2 coincidences) had 500 occurrences, 3 coincidences 470 occurrences, 4 coincidences 350 occurrences, up to 8 coincidences 2 occurrences.
In SQL compare 2 values would be:
SELECT COUNT(*) FROM
(
SELECT T.[DADOS1], T.[DADOS2], T.[DADOS3], T.[DADOS4], T.[DADOS5], T.[DADOS6], T.[DADOS7], T.[DADOS8] FROM [TABELA1] AS T WHERE [EVENTO] = 1
INTERSECT
SELECT T.[DADOS1], T.[DADOS2], T.[DADOS3], T.[DADOS4], T.[DADOS5], T.[DADOS6], T.[DADOS7], T.[DADOS8] FROM [TABELA1] AS T WHERE [EVENTO] = 3
) I
If you want : exact conciliation in all fields one to one field 1 x field 1 field 2 x field 2 etc.OR field 1 ratela against any field of table 2 ?
– Motta
Field 1 ratela against any field in table 2.
– i_melo