반응형 IT/데이터베이스2 mysql notes 1 loop DELIMITER $$ DROP PROCEDURE IF EXISTS loopInsert$$ CREATE PROCEDURE loopInsert() BEGIN DECLARE i INT DEFAULT 1; WHILE i 2020. 5. 27. Various queries 1 1. select substring(datetime, 12, 2) as hour, count(datetime) from animal_outs group by hour having hour between 9 and 19 --- if you want to only get hours using datetime, use a substring where you can define the start point and the end point of a certain column/data. datetime is formatted as YYYY-MM-DD HH:MI:SS, so the twelfth starting value is H while ending is also H resulting in hours only -.. 2019. 12. 3. 이전 1 다음 반응형