library/database/class.sqldriver.php
public function SelectCase($Field, $Options, $Alias) {
      $CaseOptions = '';
      foreach ($Options as $Key => $Val) {
         if ($Key == '')
            $CaseOptions .= ' else ' . $Val;
         else
            $CaseOptions .= ' when ' . $Key . ' then ' . $Val;
      }
      
      $Expr = array('Field' => $Field, 'Function' => '', 'Alias' => $Alias, 'CaseOptions' => $CaseOptions);
      
      if($Alias == '')
         $this->_Selects[] = $Expr;
      else
         $this->_Selects[$Alias] = $Expr;
         
      return $this;
   }
public function SelectCase($Field, $Options, $Alias) {
      $CaseOptions = '';
      foreach ($Options as $Key => $Val) {
         if ($Key == '')
            $CaseOptions .= ' else ' . $Val;
         else
            $CaseOptions .= ' when ' . $Key . ' then ' . $Val;
      }
      
      $Expr = array('Field' => $Field, 'Function' => '', 'Alias' => $Alias, 'CaseOptions' => $CaseOptions);
      
      if($Alias == '')
         $this->_Selects[] = $Expr;
      else
         $this->_Selects[$Alias] = $Expr;
         
      return $this;
   }
public function SelectCase ( $ Field , $ Options , $ Alias ) { $ CaseOptions = '' ; foreach ( $ Options as $ Key => $ Val ) { if ( $ Key == '' ) $ CaseOptions .= ' else ' . $ Val ; else $ CaseOptions .= ' when ' . $ Key . ' then ' . $ Val ; } $ Expr = array ( 'Field' => $ Field , 'Function' => '' , 'Alias' => $ Alias , 'CaseOptions' => $ CaseOptions ) ; if ( $ Alias == '' ) $ this -> _Selects [ ] = $ Expr ; else $ this -> _Selects [ $ Alias ] = $ Expr ; return $ this ; }
Allows the specification of a case statement in the select list.

@param string $Field The field being examined in the case statement.
@param array $Options The options and results in an associative array. A
blank key will be the final "else" option of the case statement. eg.
array('null' => 1, '' => 0) results in "when null then 1 else 0".
@param string $Alias The alias to give a column name.
Allows the specification of a case statement in the select list .