surfaceentity resolutionsame_as
Entity Resolutionscalar · returns boolean

SAME_AS

Check if two values refer to the same entity (fuzzy equality)

Per-row — runs once for each row.

entity-resolutionllmtext

Syntax

{{ left }} SAME_AS {{ right }}
{{ left }} SAME_AS {{ right }} AS '{{ entity_type }}'
SAME_AS({{ left }}, {{ right }})
SAME_AS({{ left }}, {{ right }}, '{{ entity_type }}')
{{ left }} SAME_ENTITY {{ right }}

Arguments

nametypedescription
leftVARCHAR
rightVARCHAR
entity_type(optional)VARCHAREntity type: company, person, address, product, or auto

About

Ask whether two values refer to the same real-world entity, even when they're spelled, formatted, or abbreviated differently. Returns a boolean — useful as a JOIN predicate for fuzzy matching or as a WHERE filter for deduplication. Examples of what it catches: "John Smith" ≡ "Smith, J." "Microsoft Corp" ≡ "MSFT" "New York City" ≡ "NYC" "Route 66" ≡ "US-66" Pass an optional `entity_type` to tighten the match rules — for example, `'person'` won't accidentally match two people who share a surname. Without it the operator auto-detects the entity type.

Examples

Company aliases match

SELECT
  same_as ('IBM', 'International Business Machines')

Different car companies don't match

SELECT
  same_as ('Toyota', 'Honda')

Name variations match with type hint

SELECT
  same_as ('John Smith', 'J. Smith', 'person')

Nearby rabbit holes

same domain
Climb back to The Looking Glass