方法1:

select min(c) from 
(select  min(b) as c from tab_name
union
select min(a) as c from tab_name);

方法2:

select least(min(A),min(B)) from table;
least(...),greatest(...)中如果含有null的话,无法得到结果
select greatest(max(A),max(B)) from table;

 

相关文章:

  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-02
  • 2021-12-07
  • 2021-12-15
  • 2021-11-02
  • 2022-12-23
  • 2021-12-02
相关资源
相似解决方案