Zitat Zitat von Miles Beitrag anzeigen
Hallo,

habe ein kleines problem im SQL.

müsste eventuell doch mit einem Case gehen oder?
Man kann auch einen CASE nehmen!
Ich würde allerding MAX() bevorzugen!

Code:
With x as 
(select 
DECIMAL(DECIMAL((0.8/A2LARG), 18, 0) * 
DECIMAL((0.6/A2PROF), 18, 0) * 
DECIMAL((0.2/A2Haut), 18, 0), 18, 0) AS V1,
DECIMAL(DECIMAL((0.8/A2LARG), 18, 0) *
DECIMAL((0.2/A2PROF), 18, 0) * 
DECIMAL((0.6/A2Haut), 18, 0), 18, 0) AS V2,
DECIMAL(DECIMAL((0.6/A2PROF), 18, 0) *
DECIMAL((0.8/A2PROF), 18, 0) * 
DECIMAL((0.2/A2Haut), 18, 0), 18, 0) AS V3, 
DECIMAL(DECIMAL((0.6/A2LARG), 18, 0) * 
DECIMAL((0.2/A2PROF), 18, 0) * 
DECIMAL((0.8/A2Haut), 18, 0), 18, 0) AS V4,
DECIMAL(DECIMAL((0.8/A2LARG), 18, 0) * 
DECIMAL((0.2/A2PROF), 18, 0) * 
DECIMAL((0.6/A2Haut), 18, 0), 18, 0) AS V5,
DECIMAL(DECIMAL((0.2/A2LARG), 18, 0) * 
DECIMAL((0.6/A2PROF), 18, 0) * 
DECIMAL((0.8/A2Haut), 18, 0), 18, 0) AS V6
from Test)
Select Max(V1, V2, V3, V4, V5, Vt)
From x;
Birgitta