Working with CASE - Exercise

Contact Us or call 1-877-932-8228
Working with CASE - Exercise

Working with CASE

Duration: 10 to 15 minutes.

In this exercise you will practice using CASE.

  1. Create a report that shows the company names and faxes for all customers. If the customer doesn't have a fax, the report should show "No Fax" in that field as shown below.Company Names and Faxes Report

Solution:

Case/Solutions/Case.sql
SELECT CompanyName,
	(CASE
		WHEN Fax IS NULL
			THEN 'No Fax'
			ELSE Fax
	END)
	AS Fax
FROM Customers;
Next