Do you really mean to have all these conditions on the query? Maybe it is too restrictive to return any records. What do you get back when you run it?
FACT_NOTE.CM_ID = DIM_CASE.CASE_ID AND
FACT_NOTE.NOTE_ID = DIM_NOTE.NOTE_ID AND
FACT_NOTE.OWNER_ID = DIM_USER.USER_ID AND
DIM_CASE.CASE_ID = FACT_CASE.CASE_ID AND
FACT_CASE.MEMBER_ID = DIM_MEMBER.MEMBER_ID AND
(DIM_NOTE.CASE_NOTETYPE LIKE '%Required%Complete') AND (DIM_CASE."TYPE" LIKE 'Behav%') AND
DIM_PAYER.PAYER_ID = DIM_USER.USER_ID AND
DIM_CASE.CASE_RECORDSTATE = 'OPEN' AND
FACT_MEMBER_DIAGNOSIS.MEMBER_ID = DIM_MEMBER.MEMBER_ID AND
DIM_MEMBER_DIAGNOSIS.MEMBERDIAGNOSIS_ID = FACT_MEMBER_DIAGNOSIS.MEMBERDIAGNOSIS_ID AND
DIM_MEMBER_DIAGNOSIS.ERROR = 'FALSE' AND DIM_MEMBER_DIAGNOSIS.DELETED_DATE IS NULL AND
DIM_MEMBER_DIAGNOSIS.DIAGNOSIS_CODE IN ('CC Level 1', 'CC Level 2', 'CC Level 3') AND
DIM_MEMBER_DIAGNOSIS.START_DATE = CURRENT_DATE OR DIM_MEMBER_DIAGNOSIS.END_DATE IS NULL)
there are ways you can list only the most recent record or the first record returned, etc. Here is a basic example of how you would select the latest.
select t.username, t.date, t.valuefrom MyTable tinner join ( select username, max(date) as MaxDate from MyTable group by username) tm on t.username = tm.username and t.date = tm.MaxDate
Using MaxDate will give you only the most recent.
I would appreciate a moment of your time to rate my level of service at your convenience. Thank you.
You can use group by to group the results by individual.
You're welcome. I would appreciate a moment of your time to rate my level of service using the OK, GOOD, or EXCELLENT rating icons at your convenience.
I am only a technical resource. For any account related questions, please contact JustAnswer directly.