---
title: "How to compare the values between 2 dataview columns?"
description: "Comparing values between two dataview columns can be done using the Gateway-SQL plugin. Queries can find matching, similar, or non-matching values, but may impact performance and require manual sampling."
url: "https://docs.itrsgroup.com/docs/faq/geneos/360019688038-geneos-how-to-compare-the-values-between-2-dataview-columns/index.html"
---
The Gateway-SQL plugin can be used to find similar values, exact values or values not in another dataview's column.

Depending on the number of table cells it needs to compare between the 2 columns, this type of query may be expensive in terms of performance and may take some time to run.

Due to the above reason, you may consider configuring the sampler on purpose NOT to sample on startup and NOT to run on its own by setting the sampling interval to `0`. To run the sampler manually, click on the **Sample now** or refresh button in the dataview.

![Sample now button](https://docscdn.itrsgroup.com/faq/images/geneos/manual-sampling-button.png)

To illustrate, if I have the following Table1 and Table2 Toolkit dataviews:

![Toolkit dataviews](https://docscdn.itrsgroup.com/faq/images/geneos/toolkit-dataviews.png)

## List the values in the NAME column of Table1 which contain the values from the name column of Table2

The query can be configured as:

```
select s.*, e.* from Table1 AS s, Table2 as e
where s.NAME like '%' || e.name || '%'
```

The matching values are shown in the below dataview:

![Matching values dataview](https://docscdn.itrsgroup.com/faq/images/geneos/matching-values-dataview.png)

The preceding dataview shows all table values from Table1 which the NAME column contains the value of name column from Table2. For example, `NAME=adapterSF123abc` contains `name=adapterSF`.

## List the values in the NAME column of Table1 which match exactly with the values from the name column of Table2

The query can be configured as:

```
select s.*, e.* from Table1 AS s, Table2 as e
where s.NAME = e.name
```

The matching values are shown in the below dataview:

![Equal common values dataview](https://docscdn.itrsgroup.com/faq/images/geneos/equal-common-values.png)

## List the values in the name column of Table2 which do not show up in the NAME column of Table1

The query can be configured as:

```
SELECT * from Table2
WHERE NOT EXISTS
(select * from Table1
where NAME like '%' || Table2.name || '%')
```

The non-matching values are shown in the below dataview:

![Non-matching values dataview](https://docscdn.itrsgroup.com/faq/images/geneos/non-matching-values.png)

For more information, see the [Gateway-SQL](https://docs.itrsgroup.com/docs/geneos/current/processing/configuration/geneos_gateway_plugins_tr/#gateway-sql) section in the Gateway Reference Guide. The SQL statements are based on [SQLite](https://www.sqlite.org/lang.html).


