sql to retrive data from same column with differnt criteria

Database
Enthusiast

sql to retrive data from same column with differnt criteria

Hi,

ID Start_date                          last_upd                   Status
100 25/04/2016  2:54:31 PM     15/05/2016  2:54:31 PM closed
102 28/04/2016  2:54:31 PM     15/05/2016  2:54:31 PM open
103 18/04/2015  2:54:31 PM     15/05/2016  2:54:31 PM open

could you please help me in retriving data  in below criteria.

 retrive  data if status is closed and then  last_upd should be in 30 days,if its open(then regargless of last_upd)

2 REPLIES
Teradata Employee

Re: sql to retrive data from same column with differnt criteria

where ((Status='closed' and last_upd > current_date-30)
or Status='open')
Enthusiast

Re: sql to retrive data from same column with differnt criteria

Thank You AtardecerR0j0.