Syntax

SQL Conditional Value with CASE Syntax

In SQL, conditional value with case: returns values based on conditions — CASE WHEN total > 100 THEN 'big' ELSE 'small' END

Quick Answer

Syntax
CASE WHEN total > 100 THEN 'big' ELSE 'small' END
SQLSyntax

Conditional Value with CASE

Code example
CASE WHEN total > 100 THEN 'big' ELSE 'small' END

Returns values based on conditions.

Learn More

How to conditional value with case in SQL

  1. Open your SQL file or editor.
  2. Copy the example, then replace its sample names and values for your code.

SQL Conditional Value with CASE Syntax

Use CASE WHEN total > 100 THEN 'big' ELSE 'small' END.

Related Syntax References

Frequently asked questions

What is the SQL syntax for conditional value with case?

Use this pattern: CASE WHEN total > 100 THEN 'big' ELSE 'small' END

Can I copy this SQL code example?

Yes. Use Copy code and adapt the example to your program.

Is this SQL syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify