# 高级处理

窗口函数：实现一些聚合函数无法实现的高级功能

```
<􏰌􏰍􏰎􏰏窗口函数> OVER ([PARTITION BY <列清单􏰰􏰱􏰲>]
                                    ORDER BY <􏰳􏰴􏰵􏰰􏰱􏰲排序用列清单>)
```

RANK，记录排序函数

按照不同商品类型，各自按照销售单价排序

![](/files/-LokoShjkv0p80C_DoIt)

```
SELECT product_name,product_type,sale_price,
                RANK() OVER (PARTITION BY product_type
                     ORDER BY sale_price) AS ranking
    FROM Product;
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://im-qianuxn.gitbook.io/pytorch/ji-suan-ji/shu-ju-ku/mysql/gao-ji-chu-li.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
