摘要:
DECLARE @SQL VARCHAR(8000)SET @SQL = 'select overcode 'SELECT @SQL = @SQL + ' , max(case header when ''' + header + ''' then 1 else 0 end) [' + header + ']'FROM (SELECT DISTINCT header FROM overtime_detail) AS aSET @SQL = @SQL + ' from overtime_det 阅读全文