drop table if exists tmpcountry; CREATE TABLE `tmpcountry` ( `id` int unsigned NOT NULL auto_increment, `ip_line` linestring NOT NULL, `low` int unsigned NOT NULL, `high` int unsigned NOT NULL, `country` char(2) NOT NULL default '-', PRIMARY KEY (`id`), SPATIAL INDEX (`ip_line`) ); INSERT INTO tmpcountry (low,high,country,ip_line) SELECT low, high, country, LineString(POINT(low,0), POINT(high,0)) FROM country;