MySql SELECT * FROM Table A 和 JOIN 列 FROM Table B WHERE LOG_ID 匹配
MySql SELECT * FROM Table A and JOIN Column FROM Table B WHERE LOG_ID Match
我需要SQL查询我在示例图片中提到了细节,希望你能理解
谢谢
试试这个查询,让我们知道它是否适合你:-
Select a.*, b.degree from table_a as a inner join table_b as b on
b.log_id=a.log_id order by a.log_id asc
在这个数据库查询中,我们在两个表之间进行了内部连接,并根据 log_id 进行匹配,最后根据 log_id 本身对其进行升序排序。
这应该有效:
SELECT a.*, b.degree
FROM a
LEFT JOIN b ON a.s_id = b.n_id
WHERE a.log_id = 102
ORDER BY a.log_id ASC;
记得将 table 名称 a
和 b
更改为正确的 table 名称。有关此主题的更多信息 here。
此代码有效:
Select a.*, b.degree from table_a as a inner join table_b as b on b.log_id=a.log_id where a.log_id="102" 按 a.log_id 升序排列;
谢谢大家
我需要SQL查询我在示例图片中提到了细节,希望你能理解
谢谢
试试这个查询,让我们知道它是否适合你:-
Select a.*, b.degree from table_a as a inner join table_b as b on b.log_id=a.log_id order by a.log_id asc
在这个数据库查询中,我们在两个表之间进行了内部连接,并根据 log_id 进行匹配,最后根据 log_id 本身对其进行升序排序。
这应该有效:
SELECT a.*, b.degree
FROM a
LEFT JOIN b ON a.s_id = b.n_id
WHERE a.log_id = 102
ORDER BY a.log_id ASC;
记得将 table 名称 a
和 b
更改为正确的 table 名称。有关此主题的更多信息 here。
此代码有效:
Select a.*, b.degree from table_a as a inner join table_b as b on b.log_id=a.log_id where a.log_id="102" 按 a.log_id 升序排列;
谢谢大家