问个SQL语句,看如何写简单
问个SQL语句,看怎么写简单
表T,列A,B,选出所有等于MAX(B)的列,我对SQL不熟悉,我写的是
select * from T where B in (select max(B) from T)
肯定有更容易的写法,我也不想引入临时变量,一句话写完,我在线等
------解决方案--------------------
select * from T where B = (select top 1 max(B) from T)
表T,列A,B,选出所有等于MAX(B)的列,我对SQL不熟悉,我写的是
select * from T where B in (select max(B) from T)
肯定有更容易的写法,我也不想引入临时变量,一句话写完,我在线等
------解决方案--------------------
select * from T where B = (select top 1 max(B) from T)