Untested and thinking off the top of my head...there are probably better ways.
,Count(Instalation) AS InstalationCount
GROUP BY Premise;
WHERE InstalationCount = 1;
DROP TABLE Data_temp;
Hope this helps,
The ONLY() aggregate function is good for this - if there's only one distinct value in the set, then it returns that value; otherwise, it returns null. So, you'd use it like this:
where not isnull(INSTALATION)
ONLY(INSTALATION) AS INSTALATION
From YourData (..)
GROUP BY PREMISE;
Note that I've done a chained LOAD here - the 2nd LOAD statement is evaluated first, and the resulting (temporary) table is used as the input to the 1st LOAD statement.
One thing to watch out for: if you're doing a Resident LOAD rather than a From LOAD (I've used a From load in the example i.e. 'FROM YourData (...)', then alter the 1st LOAD statement so that at least one of the fields is renamed (using AS).