0

我想插入查询的输出,但我无法插入输出我收到错误为 ER_TRUNCATED_WRONG_Name (1292) - 截断不正确的 DOUBLE 值:'Null'

insert into grid SELECT
  (CASE
  WHEN sample.Airtel = 'Null' THEN'0'
  WHEN sample.Airtel <'1000' THEN '1'
  WHEN sample.Airtel >'2933' THEN '3'
ELSE '2'
  END) AS airtel1,

  ( CASE
  WHEN sample.Jio = 'Null' THEN'0'
  WHEN sample.Jio <'1000' THEN '1'
  WHEN sample.Jio >'2933' THEN '3'
ELSE '2'
  END )AS jio1,

  ( CASE
  WHEN sample.Vodaidea = 'Null' THEN'0'
  WHEN sample.Vodaidea <'1000' THEN '1'
  WHEN sample.Vodaidea >'2933' THEN '3'
ELSE '2'
  END )AS voda1,

  ( CASE
  WHEN sample.Airtel_count = 'Null' THEN'0'
  WHEN sample.Airtel_count >'32' THEN 'High'
  WHEN sample.Airtel_count <='1' THEN 'Low'
ELSE 'Mid'
  END) AS airtelgrid,

    ( CASE
  WHEN sample.Jio_count = 'Null' THEN'0'
  WHEN sample.Jio_count >'32' THEN 'High'
  WHEN sample.Jio_count <='1' THEN 'Low'
ELSE 'Mid'
  END) AS jiogrid,

   (  CASE
  WHEN sample.VodaIdea_count = 'Null' THEN'0'
  WHEN sample.VodaIdea_count >'32' THEN 'High'
  WHEN sample.VodaIdea_count <='1' THEN 'Low'
ELSE 'Mid'
  END) AS vodagrid,

  sample.*
FROM
  sample

表定义如下:

CREATE TABLE `grid` (
  `Hex_id` int(50) DEFAULT NULL,
  `Airtel` int(50) DEFAULT NULL,
  `Airtel_count` int(50) DEFAULT NULL,
  `Jio` int(50) DEFAULT NULL,
  `Jio_count` int(50) DEFAULT NULL,
  `Vodaidea` int(50) DEFAULT NULL,
  `VodaIdea_count` int(50) DEFAULT NULL,
  `airtel1` int(50) DEFAULT NULL,
  `jio1` int(50) DEFAULT NULL,
  `voda1` int(50) DEFAULT NULL,
  `airtelgrid` varchar(50) DEFAULT NULL,
  `jiogrid` varchar(50) DEFAULT NULL,
  `vodagrid` varchar(50) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1

示例表定义如下:

创建表sample( Hex_idint(50) NOT NULL, Airtelint(50) NOT NULL, Airtel_countint(50) NOT NULL, Jioint(50) NOT NULL, Jio_countint(50) NOT NULL, Vodaideaint(50) NOT NULL, VodaIdea_countint(50) NOT NULL ) 引擎=MyISAM 默认字符集=latin1

4

0 回答 0