Ako v MySql zobraziť tabuľku zo všetkými dátumami pre február
SQL -> Ukážkové skripty v SQL -> Ako v MySql zobraziť tabuľku zo všetkými dátumami pre február
SELECT (SELECT ADDDATE('2024-02-01', day-1)) as dat FROM
(SELECT 1 as day
union all SELECT 2
union all SELECT 3
union all SELECT 4
union all SELECT 5
union all SELECT 6
union all SELECT 7
union all SELECT 8
union all SELECT 9
union all SELECT 10
union all SELECT 11
union all SELECT 12
union all SELECT 13
union all SELECT 14
union all SELECT 15
union all SELECT 16
union all SELECT 17
union all SELECT 18
union all SELECT 19
union all SELECT 20
union all SELECT 21
union all SELECT 22
union all SELECT 23
union all SELECT 24
union all SELECT 25
union all SELECT 26
union all SELECT 27
union all SELECT 28
union all SELECT 29
union all SELECT 30
union all SELECT 31) as days
HAVING LAST_DAY('2024-02-01')>=dat
(SELECT 1 as day
union all SELECT 2
union all SELECT 3
union all SELECT 4
union all SELECT 5
union all SELECT 6
union all SELECT 7
union all SELECT 8
union all SELECT 9
union all SELECT 10
union all SELECT 11
union all SELECT 12
union all SELECT 13
union all SELECT 14
union all SELECT 15
union all SELECT 16
union all SELECT 17
union all SELECT 18
union all SELECT 19
union all SELECT 20
union all SELECT 21
union all SELECT 22
union all SELECT 23
union all SELECT 24
union all SELECT 25
union all SELECT 26
union all SELECT 27
union all SELECT 28
union all SELECT 29
union all SELECT 30
union all SELECT 31) as days
HAVING LAST_DAY('2024-02-01')>=dat