> For the complete documentation index, see [llms.txt](https://docs.dwh.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dwh.dev/features/data-lineage/equals-column-lineage.md).

# Equals column lineage

We already have great functionality for displaying relationships from [**JOIN and WHERE** ](/features/data-lineage/join-and-where.md)clauses.

But that's not all.

Remember what we learned in school? If we know that x = y, we can substitute one for the other anywhere. Right? Now, take a look at this query:

```sql
SELECT T1.C1 FROM
  T1 JOIN T2 ON T1.C1 = T2.C3
```

We get **T1.C1** as the lineage result, correct?

But **T1.C1 = T2.C3**, which means this query is equivalent to:

```sql
SELECT T2.C3 FROM
  T1 JOIN T2 ON T1.C1 = T2.C3
```

See what's happening here? The lineage of the upstream column **T2.C3** is hidden from your view!

Have you ever encountered a tool that reveals this to you? Sure, you'll see that there's a dependency on table T2 at the object level. But no details. Good luck debugging that!

It gets even worse! If x = y and y = z, then x = z. Right?

```sql
SELECT C1 FROM
  T1 
    JOIN T2 ON C1 = C3
    JOIN T3 ON C3 = C5;
```

You get the point…

All of this becomes even more complicated when you add mathematical operations, function calls, type conversions, unions…

Can we see additional data lineage generated by the equality conditions in JOIN and WHERE?

Sure! Here's what the full data lineage would look like for the examples above:

<figure><img src="/files/rnEQYKdMvMqP4zfNjVxg" alt=""><figcaption><p>Equals lineage #1</p></figcaption></figure>

<figure><img src="/files/S9Jnqb22Zlf7DKh7m94W" alt=""><figcaption><p>Equals lineage #2</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.dwh.dev/features/data-lineage/equals-column-lineage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
