functions.sql 667 Bytes
Newer Older
Игорь's avatar
init    
Игорь committed
1
2
3
4
5
6
7
8
9
10
-- CREATE DEFINER=`root`@`localhost` FUNCTION `geodist`(`src_lat` DECIMAL(18,14), `src_lon` DECIMAL(18,14), `dst_lat` DECIMAL(18,14), `dst_lon` DECIMAL(18,14)) RETURNS decimal(18,14)
-- BEGIN
--  SET @dist := 6371 * 2 * ASIN(SQRT(
--       POWER(SIN((src_lat - ABS(dst_lat)) * PI()/180 / 2), 2) +
--       COS(src_lat * PI()/180) *
--       COS(ABS(dst_lat) * PI()/180) *
--       POWER(SIN((src_lon - dst_lon) * PI()/180 / 2), 2)
--     ));
--  RETURN @dist;
CREATE TABLE seo2 (id BIGINT AUTO_INCREMENT, url TEXT NOT NULL, h1 TEXT, title TEXT, description TEXT, body text, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) ENGINE = INNODB;