Nested Queries can be run on the AS/400. Use command STRSQL to test your query interactively.
I’m pretty sure I don’t understand exactly what you are trying to do. I’m going to assume you want ot find students that have never had a passing grade. In your example, Michelle has never had a passing grade so you want her to show up – not Peter.
I’m also going to assume the name of the table is Students.
Where Student No. not in (
Select DISTINCT Student No.
Where Grade = ‘Pass’)
Best wishes: Craig