create table ai(i int,ii int)
insert into ai select 1,2 
insert into ai select 2,2 
insert into ai select 3,2create table aii(i int,ii int)
insert into aii select 1,2 
insert into aii select 2,2 
insert into aii select 3,2
 
select max(a.i) 
from ai as a join aii as b
on a.i<b.ii

解决方案 »

  1.   

    select top 1 col1 from tabl1 where col1<(select column1 from tab2 where column2='111') order by col1 desc
      

  2.   

    select max(a.col1) from table1 a
    inner join table2 b
    on a.col1<b.column1 and b.column2='111'
      

  3.   

    Select max(col1) where column1 < (Select column1 from tab1 where column2 = '111') from tab1 
      

  4.   

    sorry:
    Select max(col1)  from tab1 where column1 < (Select column1 from tab1 where column2 = '111')
      

  5.   

    select max(col1) from tab2 
    where col1< (select column1 from tab1 where column2='111')