Skip to main content
Skip table of contents

Write SQL in alli audiences

Overview

This document will teach you how to write custom SQL for your power audiences in alli audiences.

Check if you have the ability to edit power audiences here!

Instructions

Follow the steps below once you have created a power audience as per these instructions.

  1. You probably have a couple initial questions running through your head right now, such as: 

    • Where is the audience data stored?

    • Or, how do I know which table stores which audience data?

  2. Select the lists you will be getting your data for from the CRM List Reference Box. After going through the CRM List Reference in alli audiences document, you should have copied the table ids from which you will get your data. For example: {trans-a2a9dc23-9196-4923-ae93-1c0fb41fea17}

A simple SQL query

  1. The simplest SQL query we could write is one that selects all columns from a single table.
    Here is what ours will look like:

  1. In this query, you will notice that we place the entire audience List Reference database table directly into the query.

  2. We will use this style of table formatting for all Power Audience queries.

  3. Go ahead and write your query similar to the above query, with the only change being that you might be querying a different audience list table.

  4. Next click on the Save & Preview button and ensure that you are getting the data correctly populated and getting the correct amount of members.

Before writing any complex power audience SQL queries, go through the requirements for a power audience SQL query.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.