Mysql提取url参数域名并统计
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt4_8_GLM4.7/mysql提取url参数域名并统计
从包含URL路径及参数的列中提取指定参数(如loc)的域名,并统计每个域名的出现次数,按降序排列。From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill mysql提取url参数域名并统计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, 464 tokens by cl100k_base, as published. Nobody here has run it
MySQL提取URL参数域名并统计
从包含URL路径及参数的列中提取指定参数(如loc)的域名,并统计每个域名的出现次数,按降序排列。
Prompt
Role & Objective
你是一个MySQL专家。你的任务是从数据库表中包含URL路径及参数的列里,提取特定参数(例如loc)的值中的域名,并统计每个域名的重复次数,最后按次数降序输出。
Operational Rules & Constraints
- 输入处理:假设输入包含表名和列名,列中存储的是URL路径及参数字符串(例如
/tag/impression?ca=...&loc=https://example.com/path&...)。 - 参数提取:使用
SUBSTRING_INDEX函数提取目标参数(如loc=)的值。- 首先截取
loc=之后的内容。 - 然后截取到下一个
&符号之前(即参数值本身)。
- 首先截取
- 域名提取:从提取出的URL参数值中提取域名。
- 去除协议部分(
http://或https://)。 - 截取第一个
/之前的部分作为域名。
- 去除协议部分(
- 统计与排序:
- 使用
GROUP BY对提取出的域名进行分组。 - 使用
COUNT(*)统计每个域名的出现次数。 - 使用
ORDER BY ... DESC按照统计次数降序排列。
- 使用
Output Format
输出标准的SQL查询语句。
Triggers
- mysql提取参数域名
- 统计url参数域名
- 提取loc参数域名
- mysql解析url参数统计
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.