Re: Loops and Case Statements Involving Dates

2023-08-21 Thread Ron
Since this code is in a loop, consider using clock_timestamp() instead of now(). It might not matter in this situation, though. On 8/21/23 02:07, Anthony Apollis wrote: *Please review my code and make recommendations where needed. I have this code: *``` NUMBER OF LOOPS FOR POSTGRESQL ETL:

Re: Loops and Case Statements Involving Dates

2023-08-21 Thread Peter J. Holzer
On 2023-08-21 09:07:00 +0200, Anthony Apollis wrote: > Please review my code and make recommendations where needed. I have this code: > ``` [complicated code snipped] > > > I have re-written this code to make it less complex, still doing what > it is supposed to do. I want you to review my

Re: Loops and Case Statements Involving Dates

2023-08-21 Thread jian he
On Mon, Aug 21, 2023 at 3:07 PM Anthony Apollis wrote: > > Please review my code and make recommendations where needed. I have this code: > ``` > NUMBER OF LOOPS FOR POSTGRESQL ETL: > SELECT > CASE > WHEN (((EXTRACT(DAY FROM > ((CASE > WHEN > (SELECT DISTINCT "CALDAY" FROM

Loops and Case Statements Involving Dates

2023-08-21 Thread Anthony Apollis
*Please review my code and make recommendations where needed. I have this code: *``` NUMBER OF LOOPS FOR POSTGRESQL ETL: SELECT CASE WHEN (((EXTRACT(DAY FROM ((CASE WHEN (SELECT