> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> يمثل محتويات إسقاطٍ ما في جداول MergeTree. ويمكن استخدامه للفحص الداخلي.

# mergeTreeProjection

يمثل محتويات إسقاطٍ ما في جداول MergeTree. ويمكن استخدامه للفحص الداخلي.

<div id="syntax">
  ## الصيغة
</div>

```sql theme={null}
mergeTreeProjection(database, table, projection)
```

<div id="arguments">
  ## الوسائط
</div>

| الوسيط       | الوصف                                        |
| ------------ | -------------------------------------------- |
| `database`   | اسم قاعدة البيانات التي سيُقرأ منها الإسقاط. |
| `table`      | اسم الجدول الذي سيُقرأ منه الإسقاط.          |
| `projection` | الإسقاط الذي ستتم القراءة منه.               |

<div id="returned_value">
  ## القيمة المُعادة
</div>

كائن جدول يحتوي على الأعمدة التي يوفّرها الإسقاط المحدد.

<div id="usage-example">
  ## مثال على الاستخدام
</div>

```sql theme={null}
CREATE TABLE test
(
    `user_id` UInt64,
    `item_id` UInt64,
    PROJECTION order_by_item_id
    (
        SELECT _part_offset
        ORDER BY item_id
    )
)
ENGINE = MergeTree
ORDER BY user_id;

INSERT INTO test SELECT number, 100 - number FROM numbers(5);
```

```sql theme={null}
SELECT *, _part_offset FROM mergeTreeProjection(currentDatabase(), test, order_by_item_id);
```

```text theme={null}
   ┌─item_id─┬─_parent_part_offset─┬─_part_offset─┐
1. │      96 │                   4 │            0 │
2. │      97 │                   3 │            1 │
3. │      98 │                   2 │            2 │
4. │      99 │                   1 │            3 │
5. │     100 │                   0 │            4 │
   └─────────┴─────────────────────┴──────────────┘
```

```sql theme={null}
DESCRIBE mergeTreeProjection(currentDatabase(), test, order_by_item_id) SETTINGS describe_compact_output = 1;
```

```text theme={null}
   ┌─name────────────────┬─type───┐
1. │ item_id             │ UInt64 │
2. │ _parent_part_offset │ UInt64 │
   └─────────────────────┴────────┘
```
