2024年1月29日发(作者:)
15. -> -- check input
16. -> if (pi_date_from is null) then
17. -> set pi_date_from = current_date();
18. -> end if;
19. ->
20. -> if (pi_date_to is null) then
21. -> set pi_date_to = pi_date_from;
22. -> end if;
23. ->
24. -> set pi_date_to = date_add(pi_date_from, interval 1 day);
25. ->
26. -> -- stat
27. -> select agent, count(*) as cnt
28. -> from apache_log
29. -> where request_time >= pi_date_from
30. -> and request_time < pi_date_to
31. -> group by agent
32. -> order by cnt desc;
33. -> end; //
34. Query OK, 0 rows affected (0.00 sec)
35.
36. mysql>
37. mysql> delimiter ; -- 末尾不要符号 “//”
38. mysql>
本文发布于:2024-01-29 15:04:20,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170651186016123.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |