D dey-999 Unregistered / Unconfirmed GUEST, unregistred user! 2006-07-17 #2 CorrectLine改为Sum(Case Prflos When 0 then 1 else 0 end)
S suger Unregistered / Unconfirmed GUEST, unregistred user! 2006-07-17 #3 当然是0啦。 初始时SumLine, CorrectLine 都是0的,要执行完这条SQL后才会有值。 这样吧! select CorrectLine/SumLine as BB from ( Select count(Prflos) as SumLine, Sum(Case Prflos When 0 then 1 else 0 end) as CorrectLine From H join D on H.id=d.id ) c
当然是0啦。 初始时SumLine, CorrectLine 都是0的,要执行完这条SQL后才会有值。 这样吧! select CorrectLine/SumLine as BB from ( Select count(Prflos) as SumLine, Sum(Case Prflos When 0 then 1 else 0 end) as CorrectLine From H join D on H.id=d.id ) c