mysql日時データ型
1301 ワード
//
DROP TABLE dataType_date;
CREATE TABLE dataType_date (
brithday DATE,
START DATETIME,
luanch TIME,
constellation YEAR
) ENGINE=INNODB DEFAULT CHARSET=utf8
//
/** , */
INSERT INTO dataType_date VALUES('1983-11-23 00:00:00','1983-11-23 00:00:00','1983-11-23 00:00:00');
/* , **/
INSERT INTO dataType_date VALUES('1983-11-23 00:00:00','1983-11-23 00:00:00','25:00:00');
/**
*DATETIME 1983-11-23 00:00:00
*DATE :1983-11-23
*/
INSERT INTO dataType_date VALUES('1983-11-23','1983-11-23 00:00:00','25:00:00');
/**
*
**/
INSERT INTO dataType_date VALUES('1983-11-23','1983-11-23 00:00:00','99:59:00','2000');
/**
* :
*/
SELECT * FROM dataType_date;
SELECT * FROM dataType_date dd WHERE dd.brithday='1983-11-23';
SELECT * FROM dataType_date dd WHERE dd.brithday>'1983-11-02';
SELECT * FROM dataType_date dd WHERE dd.brithday>='1983-11-02';
SELECT * FROM dataType_date dd WHERE dd.brithday LIKE '%1983%';
SELECT * FROM dataType_date dd WHERE dd.brithday LIKE '%11%';
SELECT * FROM dataType_date dd WHERE dd.brithday IN('1983-11-02','1983-11-23');