If Else

Voorbeeld:

 
IF (SELECT AVG(price) FROM titles WHERE type = 'mod_cook')
BEGIN 
SELECT SUBSTRING(title, 1, 35) AS Title FROM titles WHERE type = 'mod_cook' 
END 
ELSE 
PRINT 'Average title price is more than $15.' 

Voorbeeld met multiple if-else

 
IF (SELECT AVG(price) FROM titles WHERE type = 'mod_cook') 
BEGIN 
SELECT SUBSTRING(title, 1, 35) AS Title FROM titles WHERE type = 'mod_cook' 
END 
ELSE IF 
(SELECT AVG(price) FROM titles WHERE type = 'mod_cook') 
BEGIN SELECT SUBSTRING(title, 1, 35) AS Title FROM titles WHERE type = 'mod_cook' 
END 

{{opmerking.Naam}}:

{{opmerking.OpmerkingText}}

            

Saving your comment....

Naam is verplicht!
Email is verplicht!
Opmerking is verplicht!