i want to calculate rectangle circuit (ALU) and rectangle area (ALU) of two (D=0 and C=0) or three (D=0) or four rectangles (twice)
Y is one side and A/B/C/D is other side (if C/D exists)
SELECT BMsr.Type, BMsr.Y, BMsr.Span, BMsr.A, BMsr.B, BMsr.C, BMsr.D, 4*(A+B+C+D+A/A*Y*2+B/B*Y*2+C/C*Y*2+D/D*Y*2) AS ALU, 2*(Y*A+Y*B+Y*C+Y*D) AS GLA
FROM BMsr;
but the problem is error if C or D is zero. is there better way to do it?
Y is one side and A/B/C/D is other side (if C/D exists)
SELECT BMsr.Type, BMsr.Y, BMsr.Span, BMsr.A, BMsr.B, BMsr.C, BMsr.D, 4*(A+B+C+D+A/A*Y*2+B/B*Y*2+C/C*Y*2+D/D*Y*2) AS ALU, 2*(Y*A+Y*B+Y*C+Y*D) AS GLA
FROM BMsr;
but the problem is error if C or D is zero. is there better way to do it?