I’m using oracle SQL.
<code>ID | Name
----------
1 A
1 B
1 C
2 D
2 E
3 F
</code>
<code>ID | Name
----------
1 A
1 B
1 C
2 D
2 E
3 F
</code>
ID | Name
----------
1 A
1 B
1 C
2 D
2 E
3 F
I want to get the ID column only if in ‘Name’ it doesn’t have the letter A.
So for this example I’d want the results to be only: 2, 3.
How can I achieve that?
I tried:
<code>select distinct ID
from table
where Name <> 'A'
</code>
<code>select distinct ID
from table
where Name <> 'A'
</code>
select distinct ID
from table
where Name <> 'A'
But that obviously didn’t work…
I also tried with listagg but I could find how to use condition within it.