SELECT CONCAT(`h`.`hour`, ':', `m`.`minute`, ':00')
FROM (
SELECT '09' AS `hour`
UNION SELECT '10'
UNION SELECT '11'
UNION SELECT '12'
UNION SELECT '13'
UNION SELECT '14'
UNION SELECT '15'
UNION SELECT '16'
UNION SELECT '17'
) AS `h`
JOIN (
SELECT '00' AS `minute`
UNION SELECT '15'
UNION SELECT '30'
UNION SELECT '45'
) AS `m`
If an ENUM column is declared to permit NULL, the NULL value is a valid value for the column, and the default value is NULL. If an ENUM column is declared NOT NULL, its default value is the first element of the list of permitted values.
SET @row = 0;
SELECT *, @row := @row + 1 AS `pos`
FROM (
SELECT `t1`.`id`, `t1`.`hm`, `t2`.`name`
FROM (
SELECT `target_id` AS `id`, SUM(`cnt`) AS `hm`
FROM `votes`
GROUP BY `target_id`
) AS `t1`
JOIN `people` AS `t2` ON `t2`.`id` = `t1`.`id`
ORDER BY `t1`.`hm` DESC, `t2`.`name` ASC
LIMIT 10
) AS `x`
SELECT *
FROM (
SELECT `user_id`
FROM `user_dats`
WHERE `dat` IN (1, 2, 3, 4, 5)
GROUP BY `user_id`
) AS `uid`
JOIN `table` ON `uid`.`user_id` = `table`.`id`