---
title: Query Editor
slug: target-cja-hol/query-editor
description: Getting Started with Data Distiller
docTags: 
createdAt: 2023-11-15T14:46:41.704Z
---

```yaml
description: Getting Started with Data Distiller
```

### Query Editor [#query-editor](#)&#x20;

v

::Image[]{src="https://adbecdn.azureedge.net/labs/archbee/DataDistillerBase/ScreenShot2023-07-17at8.18.07AM.png" size="50" isUploading="false" showCaption="false"}

Now that we have confirmed that we are all connected, let’s begin the exercise. You have been tasked with joining customer profile data with event data that are stored in two separate datasets in AEP and need to use Data Distiller to join this data into a single dataset.

You will run a query to retrieve CRM ID, loyalty tier points, city, country, loyalty tier, and loyalty points from the customer profile dataset. The data will be filtered to include only Gold-tier customers and sorted by the highest loyalty points to prioritize the most engaged members.

```sql
SELECT
  _adobedemoamericas275.customerDetailsABC.crmID,
  _adobedemoamericas275.customerDetailsABC.loyaltyTierPoints,
  homeAddress.city,
  homeAddress.country,
  loyalty.points,
  loyalty.tier,
  person.name.firstName,
  person.name.lastName,
  person.birthDate,
  personID
FROM
  hol_customer_profile_dataset_abc
WHERE 
  loyalty.tier LIKE '%Gold%'
ORDER BY 
  loyalty.points DESC;
```

