neugi Posted September 13, 2006 Share Posted September 13, 2006 Hi, i've got 3 Databases with adresses. From this 3 Database want to select from the table adresse the field name.is there a way to select the 3 name fields into one.what i would like to get is not:name (table1) | name (table2) | name (table3)i would like to get only:name (table1/table2/table3)i tried to use this query but it don't work:SELECT NAME1FROM liezen.ADRESSEN cl, kirchdorf.ADRESSEN ck, gmunden.ADRESSEN cgthx Quote Link to comment https://forums.phpfreaks.com/topic/20625-select-the-same-field-form-3-databases/ Share on other sites More sharing options...
fenway Posted September 13, 2006 Share Posted September 13, 2006 You'll need to be connected to all 3 databases via the same connection, which is only possible if they're on the same box and have the same login credentials, AFAIK. Quote Link to comment https://forums.phpfreaks.com/topic/20625-select-the-same-field-form-3-databases/#findComment-91110 Share on other sites More sharing options...
neugi Posted September 13, 2006 Author Share Posted September 13, 2006 can you give me an example?thx Quote Link to comment https://forums.phpfreaks.com/topic/20625-select-the-same-field-form-3-databases/#findComment-91115 Share on other sites More sharing options...
fenway Posted September 13, 2006 Share Posted September 13, 2006 There's no example to give... if they're all on the same server, and the user/pass are the same, you should be able to run the statement you indicated. Quote Link to comment https://forums.phpfreaks.com/topic/20625-select-the-same-field-form-3-databases/#findComment-91176 Share on other sites More sharing options...
Zane Posted September 14, 2006 Share Posted September 14, 2006 [quote]is there a way to select the 3 name fields into one.[/quote]do you mean concatenating them into one fieldif that's the case you can do this[code]SELECT CONCAT(liezen.ADRESSEN, kirchdorf.ADRESSEN, gmunden.ADRESSEN) as allNames[/code]Note*they won't be separated by any spaces with that codeyou'd have to include the spaces for thatlike[quote]CONCAT(gmunden.ADRESSEN, ' ', liezen.ADRESSEN)[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/20625-select-the-same-field-form-3-databases/#findComment-91504 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.