Solved

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

Posted on 2016-09-29
2
25 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
2 Comments
 
LVL 142

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 1

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Insert values are dynamic 11 42
Create a MySQL table as easily as possible 6 38
Mysql Left Join Case 10 56
Incorrect definition of table mysql.proc 7 18
All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
I use MySQL for many of my development projects in a Windows environment. To manage my databases (and perform queries) for years I used a tool called MySQL administrator.  This tool has since been replaced by MySQL Workbench. So I decided to m…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

822 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