title: SQL case statement in Teradata
body: <p>I'm trying to write a simple IF/ELSE statement in Teradata. As far as I understand you have to use a CASE. What I want to do is write a statement that will check if a column IS NOT NULL and display something. ELSE if it IS NULL, display something else.</p>
  
  <p>Every example I found simply replaces a single value with a hard coded string or int. I'm looking for something more along the lines of this which uses the THEN statement to make another SELECT:</p>
  
  <pre><code>  SELECT CARS.VIN_NUM, CARS.DRIVER_NAMES
       CASE
         WHEN CARS.FUEL IS NOT NULL THEN SELECT CARS.DESTINATIONS
         WHEN CARS.FUEL IS NULL THEN SELECT CARS.GAS_STATIONS
       END
    FROM AUTOMOBILES CARS
    WHERE CARS.VIN_NUM IN
    ('345353',
     '354632',
     '535231')
    ORDER BY CARS.VIN_NUM
  </code></pre>
  
  <p>The end result should be a table displaying the VIN_NUM, DRIVER_NAMES, DESTINATIONS OR GAS_STATIONS based on the CASE. Is something like this possible or am I going about it the wrong way?</p>