Solved

how to create a view for a table which is exist in another database

Posted on 2016-09-29
2
28 Views
Last Modified: 2016-09-30
Hi Experts,

I have a two databases
Test1
Test2

Test1 database have table called items


I want this table data in Test2 database
I want to create a view for this table and i have to access the data via view in Test2 database;

Can some one suggest me how to do a view creation
how to get the data from Test1 database items table to Test2 database xxx view

please find the table data  in the attachment.
test.PNG
0
Comment
Question by:srikotesh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 41822999
you can always do this:
select * from otherdatabase.tablename

Open in new window


and this can be done in a view also
use test1

create view test2_Items_view
as 
select * from test2.items

Open in new window

0
 
LVL 2

Author Comment

by:srikotesh
ID: 41824021
CREATE VIEW `D2`.`example` AS SELECT * FROM `D1`.`T1`;

http://stackoverflow.com/questions/10694601/creating-view-across-different-databases
0

Featured Post

MongoDB Through a MySQL Lens

This article looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question