• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 45
  • Last Modified:

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

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
srikotesh
Asked:
srikotesh
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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
 
srikoteshAuthor Commented:
CREATE VIEW `D2`.`example` AS SELECT * FROM `D1`.`T1`;

http://stackoverflow.com/questions/10694601/creating-view-across-different-databases
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now