---
schema_version: "1"
id: 3c5e29b45170a4978b4aba7d4bd348aff5dfb098012fd41abcff18beb0f9835a
title: Write a Simple Query
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-query-guide/guides/get-started-dc-sql/write-simple-query.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/guide/write-simple-query.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0fe02b18c0c03874ad284565ffbb027882ed2b87e37695de6169f81c64a3ec8a
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# Write a Simple Query

Let's start with a simple query. View all individual customer records with a query that selects all fields from `ssot__Individual__dlm` DMO.

The `SELECT` clause uses the asterisk (\*) wildcard character to get all fields from `ssot__Individual__dlm`.

```
SELECT *
FROM "ssot__Individual__dlm"
```

To specify a subset of fields to retrieve, list the field names in the `SELECT` clause. To specify the type of object to retrieve the details from, use the `FROM` clause.

For example, this query retrieves only the first name, last name, the individual’s ID, and the key qualifier (`KQ_Id__c`).

```
SELECT  "ssot__FirstName__c",
        "ssot__LastName__c",
        "ssot__Id__c",
        "KQ_Id__c"
FROM "ssot__Individual__dlm"

```

This query output shows sample results.

| `ssot__FirstName__c` | `ssot__LastName__c` | `ssot__Id__c`        | `KQ_Id__c` |
| -------------------- | ------------------- | -------------------- | ---------- |
| `Phyllis`            | `Cotton`            | `00QHu00003W7JIAMA3` | `CRM`      |
| `John`               | `Bond`              | `003Hu00003SELnCIAX` | `CRM`      |
| `Mike`               | `Braund`            | `00QHu00003W7JICMA3` | `CRM`      |

**note:** What’s the key qualifier (`KQ_Id__c`)? Data ingested from different data sources can result in records having duplicate IDs. In our example query, the `ssot__Id__c` column sometimes contains duplicates. The key qualifier, combined with the record ID, uniquely identifies each record. Together, the key `ssot__Id__c` and the key qualifier `KQ_Id__c` form the unique, fully qualified key. To make sure that joins in Data 360 are correct, perform all joins on both the Id and the key qualifier columns. See [Data Interpretation with Fully Qualified Keys](https://help.salesforce.com/s/articleView?id=data.c360_a_data_inter_fqk.htm&type=5) in _Salesforce Help_.

Now let's view a calculated insight with its measure field and dimension field.

```
SELECT *
FROM "My_Calculated_Insight__cio"
```

For example, say we have a calculated insight that computes the number of contact point addresses for each unified individual. The insight has a measure of `count1__c` and a dimension of `ind_id__c`, which is the ID of the Individual DMO. The query results for this calculated insight are similar to this output.

| `count1__c` | `ind_id__c`                        |
| ----------- | ---------------------------------- |
| `1`         | `8608b9f028a77452a4c434ec97ea96bd` |
| `2`         | `864d017d1c4b3fe454cc5b8eab6420bc` |
| `1`         | `903c9f06924bcb170bf3c896ead0656d` |
