1

I want to connect and use union to select data from all servers.

Here's an example of what I've done for 1 server only, I had an idea to use dblink(@server1/@server2.....@server5) and combine it with union.

I need to help to solve this.

SELECT 
    name, phonenumb, address, numb
FROM 
    bio
WHERE 
    numb_count = (SELECT MAX(numb_count) FROM audience)@server2

But it's not working.

Is there another way to solve this?

Regards.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
J Saint
  • 11
  • 1
  • 3
  • Possible duplicate of [Selecting data from two different servers in SQL Server](http://stackoverflow.com/questions/1144051/selecting-data-from-two-different-servers-in-sql-server) – PoX Jan 12 '16 at 02:39
  • another reference to you http://stackoverflow.com/questions/5145637/querying-data-by-joining-two-tables-in-two-database-on-different-servers – Willie Cheng Jan 12 '16 at 02:43
  • 1
    If `@server` is a valid Oracle DBLink, that should be: `SELECT MAX(numb_count) FROM audience@server2)` the dblink name goes right behind the table name. –  Jan 12 '16 at 07:36
  • 1
    MS SQL Server or Oracle? Or both? – jarlh Jan 12 '16 at 08:15

0 Answers0