Jump to content

Select the same field form 3 Databases


neugi

Recommended Posts

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 NAME1
FROM liezen.ADRESSEN cl, kirchdorf.ADRESSEN ck, gmunden.ADRESSEN cg

thx
Link to comment
https://forums.phpfreaks.com/topic/20625-select-the-same-field-form-3-databases/
Share on other sites

[quote]is there a way to select the 3 name fields into one.
[/quote]
do you mean concatenating them into one field

if 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 code
you'd have to include the spaces for that
like

[quote]CONCAT(gmunden.ADRESSEN, ' ', liezen.ADRESSEN)[/quote]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.