Home > Database > Mysql Tutorial > body text

SQL statement to query two tables in different libraries on the same server.

伊谢尔伦
Release: 2016-11-23 10:26:45
Original
1669 people have browsed it

This method is limited to databases on the same server.
1. Create two databases, library A (table a) and library B (table b).
Second, assign the same account permissions to the two libraries.
3. Use the following statement when querying:
select * from A.dbo.a, B.dbo.b where A.dbo.a.id=B.dbo.b.id
The effect achieved by this sql statement is In database A and database B, the data with the same ID in table a and table b.
The above method is a simple join table query on the same server and different libraries.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!