Archive for the ‘mysql’ Category
membuat function di mysql
|
1 2 3 4 5 6 7 8 9 10 11 12 |
create function dms_to_dec (d int,m float,s float,dir varchar(5)) returns float begin declare hasil float; declare hasil2 float; set hasil = round(d + (m/60) + (s/3600),8); if (UCASE(dir)='W' or UCASE(dir)='S') then set hasil2 = hasil*(-1); else set hasil2 = hasil; end if; return hasil2; end; |