I have 3 tables called patients
, customers
and deliveries
. Those tables are in the same database called db
.
All the tables equally have id
, first_name
, last_name
, gender
and only deliveries
table has their own data. (the other 2 tables are currently empty.)
Now, I want to select all of them in 1 query but mysql throws an error this:
SELECT first_name, last_name, gender FROM paitents, customers, deliveries GROUP BY people LIMIT 0, 50000 Error Code: 1052. Column 'first_name' in field list is ambiguous 0.047 sec .
This is how I tried:
SELECT first_name, last_name, gender
FROM patients, customers, deliveries
GROUP BY people;
How do I select all of the tables even if some tables currently have no data?