Advertisement
kleytonklaus

GetTxIncBacilifera

Feb 21st, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.05 KB | None | 0 0
  1. delimiter $$
  2. create function GetTxIncBacilifera(tx_inc_bac varchar(103)) returns varchar (103)
  3. begin
  4.   declare faixa varchar(103);
  5.   if (tx_inc_bac >= 0 and tx_inc_bac < 12.9) then
  6.     set faixa = 'tx_inc_bac 0 - 12.9';
  7.   elseif (tx_inc_bac >= 12.9 and tx_inc_bac < 25.8) then
  8.     set faixa = 'tx_inc_bac 12.9 - 25.8';
  9.   elseif (tx_inc_bac >= 25.8 and tx_inc_bac < 38.7) then
  10.     set faixa = 'tx_inc_bac 25.8 - 38.7';
  11.   elseif (tx_inc_bac >= 38.7 and tx_inc_bac < 51.6) then
  12.     set faixa = 'tx_inc_bac 38.7 - 51.6';
  13.   elseif (tx_inc_bac >= 51.6 and tx_inc_bac < 64.5) then
  14.     set faixa = 'tx_inc_bac 51.6 - 64.5';
  15.   elseif (tx_inc_bac >= 64.5 and tx_inc_bac < 77.4) then
  16.     set faixa = 'tx_inc_bac 64.5 - 77.4';
  17.   elseif (tx_inc_bac >= 77.4 and tx_inc_bac < 90.2) then
  18.     set faixa = 'tx_inc_bac 77.4 - 90.2';
  19.   elseif (tx_inc_bac >= 90.2 and tx_inc_bac < 103) then
  20.     set faixa = 'tx_inc_bac 90.2 - 103';
  21.   elseif (tx_inc_bac >= 103 and tx_inc_bac <= 116) then
  22.     set faixa = 'tx_inc_bac 103 - 116';
  23.   end if;  
  24.   return faixa;
  25. end $$
  26. delimiter ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement