<p>Right now, I have </p>

<pre><code>SELECT gp_id FROM gp.keywords 
WHERE keyword_id = 15 
AND (SELECT practice_link FROM gp.practices 
     WHERE practice_link IS NOT NULL 
     AND id = gp_id)
</code></pre>

<p>This does not provide a syntax error, however for values where it should return row(s), it just returns 0 rows.</p>

<p>What I'm trying to do is get the gp_id from gp.keywords where the the keywords table keyword_id column is a specific value and the practice_link is the practices table corresponds to the gp_id that I have, which is stored in the id column of that table.</p>

```
```
select k.gp_id 
from gp.keywords as k,
     gp.practices as p
where
keyword_id=15
and practice_link is not null
and p.id=k.gp_id
```
```