Hi everyone
I have a query that I am not sure how to write.
The first part of the query is to find all guys that logged into an Online app (channel = 1BB)
select **
** distinct
** round(logon_date/100,0) as PERIOD,**
** a.ucn,**
** channel**
** from **
totus_fct.fct_dbanking_logon_dly a **
** left join totus_dm.dim_ol_profile_v b **
** on a.ucn = b.ucn and a.co_cde = b.co_cde
where **
** logon_date between 20180501
** and 20180630 **
** and a.channel = ('1BB')**
** and a.co_cde = 15**
** and b.curfn_status = '1'**
** and b.sso_status = '1'**
** and b.simple = '1'**
** and a.platform_protocol = 'ZOB'**
The second part looks at exactly the same tables just for Channel = 1SA (this is an Android App)
select distinct
** round(logon_date/100,0) as PERIOD,**
** a.ucn,**
** channel,**
** 'logon_app' as Type**
** from **
totus_fct.fct_dbanking_logon_dly a **
** left join totus_dm.dim_ol_profile_v b **
** on a.ucn = b.ucn and a.co_cde = b.co_cde
where **
** logon_date between (vRptStartDate) **
** and (vRptEndDate) **
** and a.channel = ('1SA')
** and a.co_cde = 15**
Now I want to know
- which guys have BOTH - but I dont know how to write it
- Which guys have 1SA but not 1BB
- Which guys have 1BB but not 1SA
All help will be appreciated
Thanks.