> For the complete documentation index, see [llms.txt](https://docs.dot-net.uz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dot-net.uz/database/ms-sql-server/select.md).

# Select

Jadvaldagi ma'lumotlarni so'rash uchun siz **SELECT** bayonotdan foydalanasiz. Quyidagilar **SELECT** bayonotning eng asosiy shaklini ko'rsatadi:

```sql
SELECT select_list FROM schema_name.table_name;
```

Ushbu sintaksisda:

* Birinchidan, banddagi ma'lumotlarni so'ramoqchi bo'lgan vergul bilan ajratilgan ustunlar ro'yxatini belgilang.
* Ikkinchidan, manba jadvalini va uning sxema nomini FROM bandda belgilang.

Bayonotni qayta ishlashda **SELECT**, SQL Server **SELECT** so'rovda birinchi bo'lib paydo bo'lishiga qaramay, avval **FROM**, keyin esa **SELECT** qayta ishlaydi.

```sql
SELECT id,name FROM Students;
```

![SELECT ishlashi](https://user-images.githubusercontent.com/91861166/187829258-a6124246-0a0e-4cfd-a425-6819ab952a5d.png)

SELECT da "\*" yordamida barcha column belgilash mumkin. Lekin bu har doim ham yaxshimas. Ba'zi xollarda dasturni sekinlashtiradi, keraksiz ma'lumotlarni oladi.

SELECT tartibi

* FROM
* ON
* JOIN
* WHERE
* GROUP BY
* WITH CUBE or WITH ROLLUP
* HAVING
* SELECT
* DISTINCT
* ORDER BY
* TOP

Misollar:

```sql
SELECT *  FROM DimEmployee  ORDER BY LastName;
SELECT e.*  FROM DimEmployee AS e ;
SELECT FirstName, LastName, StartDate AS FirstDay  FROM DimEmployee;
SELECT FirstName, LastName, BaseRate, BaseRate * 40 AS GrossPay  FROM DimEmployee ;
SELECT DISTINCT Title  FROM DimEmployee  ORDER BY Title;
```

DISTINCT turli nomlarni qaytaradi. ORDER BY tartiblaydi.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.dot-net.uz/database/ms-sql-server/select.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
