case -Rückgabe eines Wertes nach einer Auswahl
select case WERT when -1 then 'unbekannt' when 1 then 'Ja' else 'No' end from ...
oder
select case when GEBURT is null and GESCHLECHT=2 then 'Geburt ist unbekannt' when LAKTATION = 0 and GESCHLECHT=2 then 'weibl. Kalb' when LAKTATION > 0 then 'Kuh' else 'Das wird nie eine Kuh' end from ...
Tags: