Top "If-statement" questions

An "if" statement is a flow control structure in most programming languages that branches execution flow depending on a binary condition, generally evaluated at runtime.

How do I perform an IF...THEN in an SQL SELECT?

How do I perform an IF...THEN in an SQL SELECT statement? For example: SELECT IF(Obsolete = 'N' OR InStock = …

sql sql-server tsql if-statement case
Python's equivalent of && (logical-and) in an if-statement

Here's my code: def front_back(a, b): # +++your code here+++ if len(a) % 2 == 0 && len(b) % 2 == 0: return a[:(…

python if-statement keyword logical-operators and-operator
&& (AND) and || (OR) in IF statements

I have the following code: if(!partialHits.get(req_nr).containsKey(z) || partialHits.get(req_nr).get(z) < tmpmap.…

java if-statement
Putting a simple if-then-else statement on one line

I'm just getting into Python and I really like the terseness of the syntax. However, is there an easier way …

python if-statement syntax ternary-operator
Styling multi-line conditions in 'if' statements?

Sometimes I break long conditions in ifs onto several lines. The most obvious way to do this is: if (cond1 == …

python coding-style if-statement
IF statement: how to leave cell blank if condition is false ("" does not work)

I would like to write an IF statement, where the cell is left blank if the condition is FALSE. Note …

excel if-statement excel-2010 worksheet-function
How do I compare two string variables in an 'if' statement in Bash?

I'm trying to get an if statement to work in Bash (using Ubuntu): #!/bin/bash s1="hi" s2="hi" if ["$…

bash if-statement scripting
if else statement in AngularJS templates

I want to do a condition in an AngularJS template. I fetch a video list from the Youtube API. Some …

if-statement angularjs
jQuery if checkbox is checked

I have a function below that I want to only trigger when a checkbox in the same tr is checked. …

jquery checkbox if-statement
How to do a logical OR operation in shell scripting

I am trying to do a simple condition check, but it doesn't seem to work. If $# is equal to 0 or …

bash unix if-statement sh