Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have loaded two tables users (users_id, users_name...) and organizations (organizations_id, organizations_name...) from a postgreSQL database in the editor.
Now I would like to create a table users2 (users_id, users_name, users2_organizations_name, users2_organizations_id) containing the characteristics of the users plus those of the organizations using a simple LEFT JOIN query.
I don't know what to write in the editor for that despite many researches. I would love a bit of help !!
Thanks a lot !
Basically like this:
UsersWithOrganisationDetails:
SELECT ...user_fields_here... FROM ...user_table...;
LEFT JOIN (UsersWithOrganisationDetails)
SELECT ...organisation_fields_here... FROM ...organisation_table...;
Hi Victor, you have to have at leat one common field in each table to make any join. The sintaxis would be something like this:
Table1
LOAD
COMMON_FIELD,
users_id,
users_name
FROM [your_db_path]
LEFT JOIN
Table2
LOAD
COMMON_FIELD,
organizations_id,
organizations_name
FROM [your_db_path]
What are your other fields?? Have any common one between tables?
Cheers,
Andrés