<p>I have two tables that are joined together. </p>

<p>A has many B</p>

<p>Normally you would do: </p>

<pre><code>select * from a,b where b.a_id = a.id
</code></pre>

<p>To get all of the records from a that has a record in b. </p>

<p>How do I get just the records in a that does not have anything in b?</p>

```
```
select * from a where id not in (select a_id from b)
```
```
Or like some other people on this thread says:
```
```
select a.* from a
left outer join b on a.id = b.a_id
where b.a_id is null
```
```