Art :
I'm sure this is SQL-101 but I can't figure it out nor can I come up with the correct verbiage to find any useful results in web searches.
Example table:
id ext nr
289979 111-000-1002 529
392959 111-000-1002 NULL
449707 111-000-1002 335
400151 999-555-1212 NULL
456902 999-555-1212 NULL
471001 999-555-1212 NULL
I am trying to format a query to return the ext
if the nr
on all rows is NULL
so the query would return 999-555-1212
but not 111-000-1002
.
Gordon Linoff :
Is this what you want?
select ext
from t
group by ext
having max(nr) is null;