您可以使用max()
:
select max(col1 * col2)
from t;
要查找匹配的号码,请执行以下操作:
select count(*)
from t
where (t.col1 * t.col2) = (select max(t2.col1 * t2.col2) from t t2);
还可以使用窗口函数:
select count(*)
from (select t.*,
rank() over (order by col1 * col2 desc) as seqnum
from t
) t
where seqnum = 1;