SeenGee Posted May 9, 2003 Share Posted May 9, 2003 i need to join together 5 tables in a psql database i have made. the problem is that i cant seem to find the correct sql to perform the join. the tables i have are group, person, contacts, movements and treatments. group and person are connected by a group_id, established in group, each entry in the person table also has a group_id. the other tables are connected by person_number, established in person and a foreign key in all the other tables. Would really appreciate some help. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/449-sgl-question-join-5-tables/ Share on other sites More sharing options...
effigy Posted May 10, 2003 Share Posted May 10, 2003 something like this? SELECT [columns] from group, person, contacts, movements, treatments LEFT JOIN group ON group.group_id=person.group_id LEFT JOIN [tablename] ON [condition]... Quote Link to comment https://forums.phpfreaks.com/topic/449-sgl-question-join-5-tables/#findComment-1536 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.