[英]SQL: How to find the minimum number of entries linked from one table to another
[英]How to find one number in table between two number in another table in SQL
尝试这个:
select a.score,a.idline,
(select max(b.reward) from table2 b where a.idline = b.lineid and a.score > b.percentage) as low,
(select min(b.reward) from table2 b where a.idline = b.lineid and a.score < b.percentage) as high
from table1 a
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.