Jump to content

Archived

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

neugi

Select the same field form 3 Databases

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

×

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.