Reputation: 13
I am familiar with INNER JOIN
just enough to understand the basics. But is there a way that I can select all records from both tables without cluttering the SQL sting with each column name. I was thinking in the line with the below code
SELECT * FROM new_case
INNER JOIN dispatch
ON new_case.file_nr = dispatch.case_nr
WHERE new_case.id = '27'
Upvotes: 0
Views: 180
Reputation: 198
This is what i'd try;
SELECT ft.*, af.* FROM new_case ft INNER JOIN dispatch af ON (ft.file_nr = af.case_nr) WHERE new_case.id = '27'
Upvotes: 1
Reputation: 61
Results from both tables:
SELECT nc.*, d.*
FROM new_case nc
INNER JOIN dispatch d
ON nc.file_nr = d.case_nr
WHERE nc.id = '27'
Upvotes: 0