If the condition is true then the ‘if’ statement will run. Otherwise the ‘if’ statement is of no use. if condition has no ‘else’ part with ‘If’ and when condition is true then ‘if’ statement will execute and if condition is not true then other statement out of ‘if’ condition will execute. If Else portion is provide with ‘if’ condition and when the condition is false then the else statement will execute.
Syntax- If without Else part,
If (condition)
// statement execute when condition is true.
If with Else part,
If (condition)
// statement when condition is true.
Else
// statement when condition is false.
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
SQL If-Else statement:
If the condition is true then the ‘if’ statement will run. Otherwise the ‘if’ statement is of no use. if condition has no ‘else’ part with ‘If’ and when condition is true then ‘if’ statement will execute and if condition is not true then other statement out of ‘if’ condition will execute. If Else portion is provide with ‘if’ condition and when the condition is false then the else statement will execute.
Syntax- If without Else part,
If with Else part,