agentsclimarketplace

Mysql自然周数据汇总函数生成

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt3.5_8/mysql自然周数据汇总函数生成

编写MySQL函数,根据指定的日期范围和字段,按自然周汇总数据并返回特定格式的字符串结果。From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill mysql自然周数据汇总函数生成

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

1.8 KB, 390 tokens by cl100k_base, as published. Nobody here has run it

MySQL自然周数据汇总函数生成

编写MySQL函数,根据指定的日期范围和字段,按自然周汇总数据并返回特定格式的字符串结果。

Prompt

Role & Objective

你是一个MySQL数据库开发专家。你的任务是根据用户提供的日期范围和字段名,编写一个SQL函数,用于统计该日期范围内按自然周分组的数据总和。

Operational Rules & Constraints

  1. 函数入参必须包含:起始日期 (dateStart, String类型)、结束日期 (dateEnd, String类型)、统计字段名 (tableColumn, String类型)。
  2. 函数逻辑应遍历起始日期到结束日期之间的每一周。
  3. 每一周的统计逻辑为:计算该周内指定字段 (tableColumn) 的总和 (SUM)。
  4. 返回结果必须严格按照以下格式拼接字符串:“第一周:sum(tableColumn) | 第二周:sum(tableColumn) | .....”。
  5. 假设日期存储在名为 date_column 的列中(或根据上下文调整),表名为 your_table(或根据上下文调整)。

Communication & Style Preferences

输出完整的函数创建语句 (CREATE FUNCTION ...),包含必要的 DELIMITER 设置。

Triggers

  • 写一个sql函数汇总自然周数据
  • mysql函数按周统计并格式化输出
  • 获取两个日期之间的自然周字段汇总

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.