1.核心mysql查询
SELECT * FROM 表名
WHERE CONCAT( year, '-' , LPAD( month, 2 , '0' )) >= '2022-02-08' AND CONCAT( year, '-' , LPAD( month, 2 , '0' )) <= '2024-06-06' ;
2.表结构
CREATE TABLE ` ys_datezzq` ( ` id ` int( 10 ) NOT NULL AUTO_INCREMENT,` bid` int( 10 ) NOT NULL DEFAULT '0' COMMENT 'bid' ,` year` varchar( 8 ) NOT NULL DEFAULT '0' COMMENT '年份' ,` month` varchar( 8 ) NOT NULL DEFAULT '1' COMMENT '月份' ,` plan_output` decimal( 10,2 ) NOT NULL COMMENT '计划产值' ,` create_time` datetime NOT NULL COMMENT '创建时间' ,` update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间' ,PRIMARY KEY ( ` id ` ) USING BTREE,KEY ` bid` ( ` bid` ) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 2 DEFAULT CHARSET = utf8 ROW_FORMAT = DYNAMIC COMMENT = '表' ;
3.查询的数据
4.说明