I have two tables in my database
--------- ---------
| A | | B |
|---------| |---------|
| id | | id |
| name | | a_id |
--------- | name |
---------
I want to select all the records in table A
only if there is a record in table B
that points to the record in table A
( B.a_id = A.id
).
How can i achieve this? And I'd like an explanation so I understand how it's done.