--这样?
select isnull(isnull(日期1,日期2),日期3)

解决方案 »

  1.   

    select 日期1 from 表1
    union 
    select 日期2 from 表2
    union 
    select 日期3 from 表3
    order by 日期1
      

  2.   

    select 日期1 as 日期 from table
    union 
    select 日期2 from table
    union
    select 日期3 from table
      

  3.   

    drop table #t
    go
    create table #t(日期1 datetime,日期2 datetime,日期3 datetime)
    insert into #t
    select '2007-5-3','2007-5-3','2007-5-3'
    union all select '2007-5-4',null,null
    union all select '2007-5-5',null,'2007-5-5'
    union all select null,'2007-5-6','2007-5-6'select isnull(isnull(日期1,日期2),日期3) from #t/*
    ------------------------------------------------------ 
    2007-05-03 00:00:00.000
    2007-05-04 00:00:00.000
    2007-05-05 00:00:00.000
    2007-05-06 00:00:00.000(所影响的行数为 4 行)
    */
      

  4.   

    select distinct 日期 from
    (
      select 日期1 日期 from tb1 where 日期1 is not null
      union all 
      select 日期2 日期 from tb2 where 日期2 is not null
      union all 
      select 日期3 日期 from tb3 where 日期3 is not null
    )
    order by 日期
      

  5.   

    我用select isnull(isnull(日期1,日期2),日期3)
    怎么显示
    03 05 2007 12:00AM
    2007-5-04
    2007-5-05
             2007-5-06
             07 05 2007 12:00AM
      

  6.   

    用convert转换一下.convert(char(10),日期1,120)
      

  7.   

    select convert(char(10),isnull(isnull(日期1,日期2),日期3),120)