Re: Case When help
Unfortunately the query contradicts itself---Left Joining to d then stipulating CASE WHEN d.DeviceStatus != '99'AND d.publishedstatus !='99' AND d.LocationType NOT IN ('Home'), thereby turning the Left Join into an Inner Join, so you need to rethink those Left Joins.
To rejig ... CASE WHEN ... THEN 1 ELSE 0 so it returns counts ...
Select SUM(CASE WHEN ... THEN 1 ELSE 0 ) AS ..., essentially you write a pivot table, see that topic at
https://www.artfulsoftware.com/queries.php.
Edited 2 time(s). Last edit at 07/25/2021 11:57AM by Peter Brawley.
Subject
Written By
Posted
Re: Case When help
July 24, 2021 06:29PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.