- Notifications
You must be signed in to change notification settings - Fork689
If Then Else
Mathias Rangel Wulff edited this pageJun 13, 2015 ·4 revisions
Syntax:
IF expression THEN statement1 [ELSE statement2]
For example:
IF EXISTS(SELECT*FROM oneWHERE a=10)UPDATE oneSET b=200WHERE a=10 ELSEINSERT INTO oneVALUES (5,500);
Try this AlaSQL examplein jsFiddle.
See also:CASE
© 2014-2026,Andrey Gershun &Mathias Rangel Wulff
Please help improve the documentation by opening a PR on thewiki repo