Skip to content

Instantly share code, notes, and snippets.

@jimi008
Created September 30, 2020 16:23
Show Gist options
  • Save jimi008/962e72718cdd2243e4a4eff447f53215 to your computer and use it in GitHub Desktop.
Save jimi008/962e72718cdd2243e4a4eff447f53215 to your computer and use it in GitHub Desktop.
RPA Customer Segmentation
--1
SELECT *
FROM users
LIMIT 20;
--id, email, campaign, test, created_at, birthday
--2
SELECT email, birthday
FROM users
where birthday between '1980-01-01' and '1989-12-31';
--3
SELECT email, created_at
FROM users
where created_at < '2017-04-30'
limit 5;
--4
SELECT *
FROM users
where test = 'bears';
--5
SELECT *
FROM users
where campaign like 'BBB%';
--6
SELECT *
FROM users
where campaign like '%-2';
--7
SELECT *
FROM users
where campaign IS NOT NULL AND test IS NOT NULL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment