Member since
08-17-2020
2
Posts
0
Kudos Received
0
Solutions
08-17-2020
06:12 PM
I am looking for discharge within 30 days of admission. The first part of the code runs where I use case statements and create the two variables exp and exp1 , but the second when I try to look for 30 days within admission date doesn't work. How do I make this run in HIVE? I added an example of what I have and what I would expect to get in the new table CREATE TABLE new AS
SELECT *,
case when status in ('28' ,'44' ,'13' ) then 1 else 0 end as exp,
case when status ='33' then 1 else 0 end as exp1
from old
WHERE DATE_FORMAT (clinic_admit_dt, 'yyyyMM') >= '201608' AND DATE_FORMAT(clinic_discharge_dt, 'yyyyMM') <= '201610' , 30)
);
... View more
Labels:
- Labels:
-
Apache Hive