SQL level nested SELECT
<p>I am stuck a little bit with my SQLite3 query.
I have following table, where I want to select only rows which are invalid.
Table contains servers in various countries and each server can contain number of application instances. Each application instance can be valid (e.g. success check or so..) or invalid (if control went wrong)</p>

<p>My table is something like this:</p>

<pre><code>Country     ServerID     Application     Validation
  usa          ABC1       Mailserver           1
  usa          ABC1       Mailserver           1
  usa          ABC1       Mailserver           0
  usa          ABC1       LDAPserver           0
  usa          ABC1       Voiceserver          0
  usa          ABC2       Voiceserver          1
 canada        BCA1       Mailserver           1
 canada        BCA2       LDAPserver           1
 canada        BCA2       Voiceserver          0
 ..............................................   
</code></pre>

<p>Now I want to select Country, ServerID and Application where at least one of instances is invalid. So output should be:</p>

<pre><code>Country     ServerID     Application
  usa          ABC1       Mailserver
  usa          ABC1       LDAPserver
  usa          ABC1       Voiceserver
 canada        BCA2       Voiceserver
</code></pre>

<p>I've already made few ruby scripts for similar problems, but I had an idea to solve it directly in database. 
I was unsuccesful with some inner joins, distinct queries and so on. </p>

<p>So I will be very glad, if someone could gives helping hand.</p>

<p>Thanks in advance :)</p>