Home > Database > Mysql Tutorial > SQL statement to query two tables in different libraries on the same server.

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

伊谢尔伦
Release: 2016-11-23 10:26:45
Original
1735 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:
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
Latest Issues
sql file
From 1970-01-01 08:00:00
0
0
0
php - Overhead of prepare vs sql?
From 1970-01-01 08:00:00
0
0
0
Print sql statement
From 1970-01-01 08:00:00
0
0
0
Pass array to SQL insert query using PHP
From 1970-01-01 08:00:00
0
0
0
sql optimization or
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template