How to achieve in the case of a packet to another time field query results?

If there is such a table:

Script is as follows:

TABLE jl_site_operation` the IF EXISTS `the DROP;
the CREATE TABLE jl_site_operation`` (
`id` int (. 11) the AUTO_INCREMENT the NOT NULL,
` site_id` int (. 11) the COMMENT the DEFAULT NULL '- station ID',
`param_id` int (. 11) the DEFAULT NULL COMMENT 'parameter id (jl_parameter_config association table ID)',
`param_value` VARCHAR (255) the DEFAULT NULL COMMENT 'parameter value corresponding to the name',
` param_value_type` tinyint (1) the DEFAULT NULL COMMENT 'parameter type value [0 represents the state value 1 Representative numeric type] ',
`param_value_unit` VARCHAR (255) the COMMENT the DEFAULT NULL' parameter value unit ',
` the DEFAULT NULL datetime add_time` the COMMENT' record addition time ',
a PRIMARY KEY ( `id`)
) ENGINE =. 11 = the InnoDB the AUTO_INCREMENT the DEFAULT CHARSET = utf8 COMMENT = '- station operation information table';

-- ----------------------------
-- Records of jl_site_operation
-- ----------------------------
INSERT INTO `jl_site_operation` VALUES ('6', '1', '2', '20', '1', '℃', '2019-12-03 08:54:16');
INSERT INTO `jl_site_operation` VALUES ('7', '1', '3', '80', '0', '%', '2019-12-03 08:54:16');
INSERT INTO `jl_site_operation` VALUES ('8', '1', '2', '20', '1', '℃', '2019-12-04 08:54:45');
INSERT INTO `jl_site_operation` VALUES ('9', '1', '3', '80', '0', '%', '2019-12-04 08:54:45');
INSERT INTO `jl_site_operation` VALUES ('10', '1', '2', '20', '1', '℃', '2019-12-02 08:54:16');

 

I hope every param_id latest recording time is to get the standard query id to get two records of 89?

Will the statement is what it looks like.

 

 

Guess you like

Origin www.cnblogs.com/hm1250446609/p/11981956.html