IT/데이터베이스 (2) 썸네일형 리스트형 mysql notes 1 loop DELIMITER $$ DROP PROCEDURE IF EXISTS loopInsert$$ CREATE PROCEDURE loopInsert() BEGIN DECLARE i INT DEFAULT 1; WHILE i 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 -.. 이전 1 다음