TABLE WITHOUT ID
file.link AS Name, by AS By, in AS In, of AS Of, date AS Date, year AS Year
FROM #Type
WHERE
(
(
any(contains(by, this.by))
AND
by
)
OR
(
any(contains(in, this.in))
AND
in
)
OR
(
any(contains(of, this.of))
AND
of
)
OR
(
any(contains(in, this.file.name))
OR
any(contains(in, this.file.link))
)
OR
(
any(contains(of, this.file.name))
OR
any(contains(of, this.file.link))
)
AND
file.name !=this.file.name
)
SORT file.etags DESC, date DESC, year DESC