boog
  • Member for 2 years
  • Last seen more than a month ago
  • Buffalo, NY, USA
postgresql - declaring variables to be used for start_time - end_time range
1 votes

This is what my final solution looked like, and worked for me. DO $$ DECLARE --Specify start date - end date in YYYY-MM-DD format. start_date timestamp := '2020-10-1'; end_date timestamp := '2020-10-...

View answer
Counting number of occurrences, how to "group by"
0 votes

Well, I was able to get it working. If anyone else has some similar scenario, here's what worked: select casenum, matcode as casetype, date_opened, sp_first_party(casenum) as client, sp_name(...

View answer
Difficult multi-directional join
Accepted answer
0 votes

I've since worked out the specific issue this post focused on (the joins)... and have moved on to a new set of issues with it. So to keep the post on topic I'm going to answer/close it up. Nobody ...

View answer
How to select only one row for each distinct value
0 votes

SELECT ( SELECT count(distinct cases.casenum) FROM (cases INNER JOIN user_case_data ON cases.casenum=user_case_data.casenum) WHERE (user_case_data.discharged_date >= '##START##' AND ...

View answer