Documentos de Académico
Documentos de Profesional
Documentos de Cultura
begin
declare v_min int default 0;
declare v_charge int;
select timestampdiff(minute,v_time,now()) into v_min from tickets where car=v_car and time_out is
null;
select rate into v_charge from rates where time_charge<=v_min and dayof_week=day(now()) order by
time_charge desc limit 1;
/*if isnull(v_charge) then end if;*/
return v_charge;
end;
--set the last name to first name
select *,concat(right(name,locate(' ',reverse(name))),' ',
left(name,length(name)-locate(' ',reverse(name)))) as emp from employee;
select *,rpad(right(name,locate(' ',reverse(name))),length(name),concat(' ',left(name,length(name)-
locate(' ',reverse(name)))))from employee
----####set first name to be last name
select *,concat(right(name,(length(name)-locate(' ',name))),' ',left(name,locate(' ',name)))as emp
from employee