Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql case

 select 
(CASE
	WHEN (market_cap < 300000000) THEN 'micro'
	WHEN (market_cap < 2000000000) THEN 'small'
	WHEN (market_cap < 10000000000) THEN 'mid'
	WHEN (market_cap < 50000000000) THEN 'large'
ELSE 'mega'
END) AS `cap_type`
from companies;
 
PREVIOUS NEXT
Tagged: #mysql #case
ADD COMMENT
Topic
Name
8+6 =