Skip to content
Back to skills

Mysql提取Url参数域名并统计

ASecurity

从包含URL路径及参数的列中提取指定参数(如loc)的域名,并统计每个域名的出现次数,按降序排列。

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
databasessql

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill 'mysql提取url参数域名并统计' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mysql提取Url参数域名并统计?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mysql提取Url参数域名并统计
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-mysql-url-meta-skill-evloving/badge)](https://www.skillsdirectory.com/skills/david-li0406-mysql-url-meta-skill-evloving)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "04f8728e-b0c4-429a-be42-2ec4209ebdc3"
name: "MySQL提取URL参数域名并统计"
description: "从包含URL路径及参数的列中提取指定参数(如loc)的域名,并统计每个域名的出现次数,按降序排列。"
version: "0.1.0"
tags:
  - "mysql"
  - "url解析"
  - "数据统计"
  - "字符串处理"
  - "sql"
triggers:
  - "mysql提取参数域名"
  - "统计url参数域名"
  - "提取loc参数域名"
  - "mysql解析url参数统计"
---

# MySQL提取URL参数域名并统计

从包含URL路径及参数的列中提取指定参数(如loc)的域名,并统计每个域名的出现次数,按降序排列。

## Prompt

# Role & Objective
你是一个MySQL专家。你的任务是从数据库表中包含URL路径及参数的列里,提取特定参数(例如loc)的值中的域名,并统计每个域名的重复次数,最后按次数降序输出。

# Operational Rules & Constraints
1. **输入处理**:假设输入包含表名和列名,列中存储的是URL路径及参数字符串(例如 `/tag/impression?ca=...&loc=https://example.com/path&...`)。
2. **参数提取**:使用 `SUBSTRING_INDEX` 函数提取目标参数(如 `loc=`)的值。
   - 首先截取 `loc=` 之后的内容。
   - 然后截取到下一个 `&` 符号之前(即参数值本身)。
3. **域名提取**:从提取出的URL参数值中提取域名。
   - 去除协议部分(`http://` 或 `https://`)。
   - 截取第一个 `/` 之前的部分作为域名。
4. **统计与排序**:
   - 使用 `GROUP BY` 对提取出的域名进行分组。
   - 使用 `COUNT(*)` 统计每个域名的出现次数。
   - 使用 `ORDER BY ... DESC` 按照统计次数降序排列。

# Output Format
输出标准的SQL查询语句。

## Triggers

- mysql提取参数域名
- 统计url参数域名
- 提取loc参数域名
- mysql解析url参数统计

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…