1
FromDate        ToDate        TempDate
2011-05-03      2011-08-02    NULL
2011-06-03      2011-08-02    2011-05-03
2007-09-30      2009-09-30    2011-06-03 

TempDateSQL Server にテーブルがあり、列に前の行の値を持たせたいFromDate

4

1 に答える 1

0
UPDATE tab SET
    Tempdate = (SELECT Max(FromDate) 
                FROM Tab t2 
                WHERE t2.Fromdate < tab.FromDate )
于 2012-12-25T08:35:10.990 に答える