Mysql connection query:
MysqlConnection query supports multi-Table connection
Get a table:
Method 1: (subquery and connection query are mixed)
Step 1:
result.id, t_name h_name,match_time,result teams result teams.t_idresult.h_id
Step 2:
result.id ,t_name g_name teams result teams.t_idresult.g_id
Get
t1.id,h_name,g_name,result,match_time result.id, t_name h_name,match_time,result teams result teams.t_idresult.h_id) result.id ,t_name g_name teams result teams.t_idresult.g_id) t1.idt2.id;
You can get
The result is coming out, a little tedious.
result.id,t1.t_name h_name ,t2.t_name g_name ,result,match_time t1 result.h_id t2 t2.t_idresult.g_id;
You can get:
TeamsTable to be connected2So there must beAlias
t1.name p_name,t2.name son_name subject t1 subject t2 t1.idt2.pid;
You can get
To facilitate the exercise, or to obtain the SQL statement for table creation and data filling, click to obtain the exercise SQL.