Function: SELECT *

Use this function to return all results from a certain sub-query.
Note: This function is only supported  when selecting from a single sub-query. It will not support querying directly “FROM CoolaData”, nor from joined tables.

SELECT *
FROM (
  SELECT customer_user_id
  FROM CoolaData
  WHERE date_range(last 7 days)
)

Function: IN (sub_select)

To use the “IN” function with sub-select, please include a sub-select over the required data source in the “from” clause, and then apply the condition on it. See example:

SELECT customer_user_id
FROM (
    SELECT customer_user_id 
    FROM cooladata
    WHERE date_range(current month)
)
WHERE customer_user_id in (
    SELECT customer_user_id 
    FROM cooladata
    WHERE date_range(previous month) 
)

Function: CurrentCoolaDataUser

The special property “CurrentCoolaDataUser” can be used in a CQL query to automatically identify the current active CoolaData user. Once computed it will be replaced with the value of the current user’s email. For example, the following query will show all the article_ids that belong to the current active user:

SELECT article_id, count(*) views
FROM cooladata
WHERE date_range(current month) and email=CurrentCoolaDataUser
Print Friendly, PDF & Email