私はあなたがマッチするタイプとカラムの種類に関する正確な情報にトリグラムの類似性を使用できると思います。
SELECT "first_name", "last_name", "description",
CASE
WHEN SIMILARITY("first_name", 'ohns') >= 1.0 THEN 'exact'
WHEN SIMILARITY("first_name", 'ohns') > 0.0 THEN 'partial'
ELSE 'no'
END AS "first_name_match",
CASE
WHEN SIMILARITY("last_name", 'ohns') >= 1.0 THEN 'exact'
WHEN SIMILARITY("last_name", 'ohns') > 0.0 THEN 'partial'
ELSE 'no'
END AS "last_name_match",
CASE
WHEN SIMILARITY("description", 'ohns') >= 1.0 THEN 'exact'
WHEN SIMILARITY("description", 'ohns') > 0.0 THEN 'partial'
ELSE 'no'
END AS "description_match"
FROM (VALUES
('Andy', 'Johnson', 'blah blah blah'),
('Andress', 'Bush', 'blah blah'),
('Ohns', 'Johnson', 'blah')
) AS I("first_name", "last_name", "description")
WHERE (SIMILARITY("first_name", 'ohns') + SIMILARITY("last_name", 'ohns') + SIMILARITY("description", 'ohns')) > 0.0
first_name | last_name | description | first_name_match | last_name_match | description_match
------------+-----------+----------------+------------------+-----------------+-------------------
Andy | Johnson | blah blah blah | no | partial | no
Ohns | Johnson | blah | exact | partial | no
はあなたがここにアクションでSQLを表示することができます:
http://sqlfiddle.com/#!17/9eecb/6356
は、私はデモのような単純なSQLの例を作りました