The OS disk on my home server has just died - boo hoo! So I can't experiment, so this will need hacking . . .
The following will identify the rows that are not N/A:You could outer join that sub-query (is that legal? *** - might need a work-around) to the original query, using NVL(MyType, 'N/A') to get the final value.Code:Select LS_ID, Max(RTYPE) MyType From whatever Where RTYPE <> 'N/A' Group by LS_ID Having count(DISTINCT RTYPE) = 1
It looked as if an analytic function was the answer, but I can't see it.
*** Just seen examples of this on AskTom so its OK. Must have been thinking of Rdb or SQL/400 or something . . . ,




Reply With Quote