Reputation: 47
so I have these tables:
a: id (primary key, foreign key to b), details, steps
b: id(primary key), field1, field2, field3, field4
How do I get all of the data of a and b using a select statement? would a "select * from a" automatically get all of the details of b associated with a? What would that specifically do?
Upvotes: 0
Views: 48
Reputation: 6418
SELECT * FROM A
INNER JOIN B ON A.ID=B.ID
Change the join type (e.g. to LEFT OUTER JOIN, RIGHT OUTER JOIN, or FULL OUTER JOIN) if you want to include rows that don't have a match in the other table.
Upvotes: 2