November 4th, 2016, 02:45 PM
Query table with two foreign keys linked to 2 additional tables
I have 3 tables: servers, groups & osversion. There are 2 foreign keys in the servers table that links to an entry in the groups & osversion tables.
The table structure is as follows:
I am having trouble creating a query that will display the servers with their respective group name and OS version. I am fairly new to SQL and
know that it will require JOINs but after searching and trying different things I can't get it right and hoping someone can help me. I'm sure this
one should be pretty easy for all the SQL gurus out there!
November 4th, 2016, 03:04 PM
tip: do not embed the name of the table into the name of the column, as this increases query text noise over signal
ON osversion.os_id = servers.server_osversion
ON groups.group_id = servers.group_id
Comments on this post