delphi123 Posted October 31, 2009 Share Posted October 31, 2009 Hi folks, Am really struggling with this one, I've got a single table (out of my control unfortunately) which has data stored in it, two fields I need are site url and site description, these are identified by their ids of 18 and 19 respectively as you can see in this screenshot: Now I'm trying to join these values as new columns to another table, but it's just not working I can get one working fine, just not both, can anyone help? SELECT urldb.data_txt, descdb.data_txt, jos_sobi2_item.title FROM jos_sobi2_fields_data AS urldb ON urldb.fieldid = 18 Inner Join jos_sobi2_fields_data AS descdb ON descdb.itemid = urldb.itemid AND urldb.fieldid = 19 Inner Join jos_sobi2_item ON urldb.itemid = jos_sobi2_item.itemid Quote Link to comment https://forums.phpfreaks.com/topic/179736-solved-joining-table-twice/ Share on other sites More sharing options...
Mchl Posted October 31, 2009 Share Posted October 31, 2009 SELECT urldb.data_txt, descdb.data_txt, jos_sobi2_item.title FROM jos_sobi2_fields_data AS urldb INNER JOIN jos_sobi2_fields_data AS descdb ON descdb.itemid = urldb.itemid AND descdb.fieldid = 19 AND urldb.fieldid = 18 INNER JOIN jos_sobi2_item ON urldb.itemid = jos_sobi2_item.itemid Quote Link to comment https://forums.phpfreaks.com/topic/179736-solved-joining-table-twice/#findComment-948312 Share on other sites More sharing options...
delphi123 Posted October 31, 2009 Author Share Posted October 31, 2009 great stuff, thanks! Quote Link to comment https://forums.phpfreaks.com/topic/179736-solved-joining-table-twice/#findComment-948370 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.