Advertisement
nemanja-zigic

Untitled

Apr 19th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. SELECT
  2. Hex(hec_act_plannedactions.HEC_ACT_PlannedActionID) AS action_id,
  3. hec_act_plannedactions.IsPerformed AS performed,
  4. hec_act_performedactions.IfPerfomed_DateOfAction AS performed_on_date,
  5. hec_act_performedaction_diagnosisupdate_localizations.IM_PotentialDiagnosisLocalization_Code
  6. FROM
  7. hec_cas_case_relevantplannedactions
  8. INNER JOIN hec_act_plannedactions ON hec_cas_case_relevantplannedactions.PlannedAction_RefID =
  9. hec_act_plannedactions.HEC_ACT_PlannedActionID AND hec_act_plannedactions.Tenant_RefID =
  10. x'3CC9B86BF340704696977DDB940A51E1' AND hec_act_plannedactions.IsDeleted = 0
  11. INNER JOIN hec_act_plannedaction_2_actiontype ON hec_act_plannedactions.HEC_ACT_PlannedActionID =
  12. hec_act_plannedaction_2_actiontype.HEC_ACT_PlannedAction_RefID AND hec_act_plannedaction_2_actiontype.Tenant_RefID =
  13. x'3CC9B86BF340704696977DDB940A51E1' AND hec_act_plannedaction_2_actiontype.IsDeleted = 0
  14. INNER JOIN hec_act_actiontype ON hec_act_plannedaction_2_actiontype.HEC_ACT_ActionType_RefID =
  15. hec_act_actiontype.HEC_ACT_ActionTypeID AND hec_act_actiontype.Tenant_RefID = x'3CC9B86BF340704696977DDB940A51E1'
  16. AND hec_act_actiontype.IsDeleted = 0
  17. LEFT JOIN hec_act_performedactions ON hec_act_plannedactions.IfPerformed_PerformedAction_RefID =
  18. hec_act_performedactions.HEC_ACT_PerformedActionID AND hec_act_performedactions.Tenant_RefID =
  19. x'3CC9B86BF340704696977DDB940A51E1' AND hec_act_performedactions.IsDeleted = 0
  20. LEFT JOIN hec_act_performedaction_diagnosisupdates ON hec_act_performedactions.HEC_ACT_PerformedActionID =
  21. hec_act_performedaction_diagnosisupdates.HEC_ACT_PerformedAction_RefID AND
  22. hec_act_performedaction_diagnosisupdates.Tenant_RefID = x'3CC9B86BF340704696977DDB940A51E1' AND
  23. hec_act_performedaction_diagnosisupdates.IsDeleted = 0
  24. LEFT JOIN hec_act_performedaction_diagnosisupdate_localizations
  25. ON hec_act_performedaction_diagnosisupdates.HEC_ACT_PerformedAction_DiagnosisUpdateID =
  26. hec_act_performedaction_diagnosisupdate_localizations.HEX_EXC_Action_DiagnosisUpdate_RefID AND
  27. hec_act_performedaction_diagnosisupdate_localizations.Tenant_RefID = x'3CC9B86BF340704696977DDB940A51E1' AND
  28. hec_act_performedaction_diagnosisupdate_localizations.IsDeleted = 0
  29. INNER JOIN hec_cas_cases ON hec_cas_case_relevantplannedactions.Case_RefID = hec_cas_cases.HEC_CAS_CaseID
  30. WHERE
  31. hec_cas_case_relevantplannedactions.Tenant_RefID = x'3CC9B86BF340704696977DDB940A51E1' AND
  32. CAST(hec_cas_cases.CaseNumber AS UNSIGNED) = 12791 AND
  33. hec_act_actiontype.GlobalPropertyMatchingID LIKE '%after%'
  34. ORDER BY
  35. hec_cas_case_relevantplannedactions.Creation_Timestamp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement