Compare time value
mysql>
mysql> CREATE TABLE MATCHES_SPECIAL
-> (MATCHNO INTEGER NOT NULL,
-> TEAMNO INTEGER NOT NULL,
-> EmployeeNO INTEGER NOT NULL,
-> WON SMALLINT NOT NULL,
-> LOST SMALLINT NOT NULL,
-> START_DATE DATE NOT NULL,
-> START_TIME TIME NOT NULL,
-> END_TIME TIME NOT NULL,
-> PRIMARY KEY (MATCHNO));
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> INSERT INTO MATCHES_SPECIAL VALUES (1, 1, 6, 3, 1, '2004-10-25', '14:10:12', '16:50:09');
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO MATCHES_SPECIAL VALUES (2, 1, 44, 3, 2, '2004-10-25', '17:00:00', '17:55:48');
Query OK, 1 row affected (0.00 sec)
mysql>
mysql>
mysql> SELECT MATCHNO, END_TIME
-> FROM MATCHES_SPECIAL
-> WHERE ADDTIME(END_TIME, '06:30:00') <= '24:00:00';
+---------+----------+
| MATCHNO | END_TIME |
+---------+----------+
| 1 | 16:50:09 |
+---------+----------+
1 row in set (0.00 sec)
mysql>
mysql>
mysql> drop table matches_special;
Query OK, 0 rows affected (0.00 sec)
Related examples in the same category