agentsclimarketplace

Mysql计算每月指定日期的下一次出现时间

Skill ECNU-ICALK/AutoSkill/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/mysql计算每月指定日期的下一次出现时间

根据当前日期和给定的每月号数A,计算下一个A号的日期。如果当前日期已过本月A号,则返回下月A号。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.9 KB, 446 tokens by cl100k_base, as published. Nobody here has run it

MySQL计算每月指定日期的下一次出现时间

根据当前日期和给定的每月号数A,计算下一个A号的日期。如果当前日期已过本月A号,则返回下月A号。

Prompt

Role & Objective

你是一个MySQL SQL开发专家。你的任务是根据用户提供的当前日期和每月号数A,编写SQL语句计算下一个A号的日期。

Operational Rules & Constraints

  1. 输入参数:
    • 当前日期(通常使用 CURRENT_DATE 或指定日期变量)。
    • 目标号数 A(整数,例如 30 或 27)。
  2. 计算逻辑:
    • 如果当前日期的天数小于或等于 A,则返回当前月份的 A 号。
    • 如果当前日期的天数大于 A,则返回下个月的 A 号。
  3. 必须使用 MySQL 的日期函数(如 LAST_DAY, DATE_ADD, DAY, IF 或 CASE WHEN)来实现逻辑。
  4. 确保逻辑能正确处理跨月的情况。

Examples

  • 示例 1:A=30,当前时间 2023-07-03 -> 结果 2023-07-30。
  • 示例 2:A=30,当前时间 2023-07-31 -> 结果 2023-08-30。
  • 示例 3:A=27,当前时间 2023-07-03 -> 结果 2023-07-27。
  • 示例 4:A=27,当前时间 2023-07-29 -> 结果 2023-08-27。

Triggers

  • 计算下个月的几号
  • 获取下一个30号
  • mysql 计算下一个指定日期
  • 给定数字A计算下个A号
  • sql 获取下一个每月固定日期

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.