Advertisement
Guest User

Untitled

a guest
May 18th, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.72 KB | None | 0 0
  1. SELECT Dyspnoea.d, SUM(Dyspnoea.p*Either.p*Tuberculosis.p*Asia.p*p*Smoking.p*Bronchitis.p)
  2.     --SELECT Dyspnoea.d, SUM(((Dyspnoea.p*Either.p*Tuberculosis.p*Asia.p)+(Dyspnoea.p*Either.p*LungCancer.p*Smoking.p)) + (Dyspnoea.p*Bronchitis.b*Smoking.p))
  3.     SELECT Dyspnoea.d, SUM(Dyspnoea.p*Either.p*Tuberculosis.p*Asia.p*p*Smoking.p*Bronchitis.p)
  4.     FROM Dyspnoea
  5.     INNER JOIN Either ON Dyspnoea.e = Either.e
  6.     INNER JOIN Tuberculosis ON Either.t = Tuberculosis.t
  7.     INNER JOIN Asia ON Tuberculosis.a = Asia.a
  8.     INNER JOIN LungCancer ON Either.l = LungCancer.l
  9.     INNER JOIN Bronchitis ON Dyspnoea.b = Bronchitis.b
  10.     INNER JOIN Smoking ON LungCancer.s = Smoking.s AND Bronchitis.s = Smoking.s
  11.     WHERE Asia.a = 1 AND Smoking.s = 0
  12.     GROUP BY Dyspnoea.d
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement