Re: [GENERAL] count records in two different table joined by

2017-07-07 Thread David G. Johnston
On Fri, Jul 7, 2017 at 3:49 AM, Patrick B wrote: > I want this to work: > > WITH account_status AS ( > select > CASE > WHEN regdate = 1 THEN 'yes' > WHEN regdate = 2 THEN 'no' > end as status_a, > count(t2.id) as t2_count > from test1 as t1 > join test2 as t2 on

Re: [GENERAL] count records in two different table joined by

2017-07-07 Thread Patrick B
2017-07-07 22:32 GMT+12:00 Thomas Markus : > Hi, > > Am 07.07.17 um 12:16 schrieb Patrick B: > > Hi guys! > > I've got 2 tables, and I need to get some data between them. > > test1: > > WITH account_status AS ( > select > CASE > WHEN regdate = 1 THEN 'yes' > WHEN

Re: [GENERAL] count records in two different table joined by

2017-07-07 Thread Thomas Markus
Hi, Am 07.07.17 um 12:16 schrieb Patrick B: Hi guys! I've got 2 tables, and I need to get some data between them. test1: WITH account_status AS ( select CASE WHEN regdate = 1 THEN 'yes' WHEN regdate = 2 THEN 'no' from test1 end as status_a )

[GENERAL] count records in two different table joined by

2017-07-07 Thread Patrick B
Hi guys! I've got 2 tables, and I need to get some data between them. test1: WITH account_status AS ( select CASE WHEN regdate = 1 THEN 'yes' WHEN regdate = 2 THEN 'no' from test1 end as status_a ) select status_a from account_status group by status_a test2: WITH user_status AS (