
Originally Posted by
codeguyz
I really wish I could just say "SELECT * FROM team, users" and it would just have all of the information available.
since those two tables aren't related, then what you might be thinking of is a UNION query
Code:
SELECT 'team' AS source_table
, staff_id AS id
, staff_first_name AS first_name
, ...
FROM team
UNION ALL
SELECT 'users' AS source_table
, id AS id
, NULL AS first_name
, ...
FROM users
the thing you need to be careful of here is that each SELECT must have the same number of columns, the column datatypes should be compatible, and you can use NULL placeholders when one of the tables is missing a corresponding column that the other has
Bookmarks