# Select Method

## Overview

The **Select** method in QueryDeck allows you to retrieve data from your database using RESTful API endpoints. This method is essential for fetching specific records from a table. You can apply advanced filtering, sorting, and pagination techniques to customize your queries and get the precise data you need.

With QueryDeck’s Select method, you can:

* Retrieve specific columns to optimize data transfer.
* Apply conditions to filter records.
* Use sorting for ordered results.
* Implement pagination using `limit` and `offset`.

It is a versatile method designed to enhance data access efficiency while ensuring that you only fetch the required information.

## Using the Select Method

Once you are logged in, follow these steps to create and test your first `Select` query:

#### 1. Access the App&#x20;

* Click on the **Demo App** button located at the bottom-right corner of the screen.
* This opens QueryDeck's demo environment where you can test API features.
* It doesn't have to be the demo app, you may choose any app of your choice.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf6lVnDWgKlQ_Y1dCaIucnL0Mmn7ZjbajfByXE_SREJ9uHU5LY8mEtITciLhyZAHnLomhpbFXdO4TiEFjrGGFkI883gPa4dB26ja-XIHH4GoaApSjdbjImFWR_L5Gg3vAmM3upTjA?key=RlGttIorZEntZNt64lpV-H5a" alt=""><figcaption></figcaption></figure>

#### 2. Select a Base Table

* In the app window, choose a **base table** to query. For this example, we'll use the `customers` table.
* Select the desired table from the dropdown menu.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeaLAxVznDoB9a5zsCgQbCtvHcwDVkRvhWv_cPJseyXxyoc6we1Hv1pqJF5X3jDgO2Ts3woiscrBEWPhkLQ4H9EOOW0No7-hxVPCsbTCsU6mHNDJ6kS0NSkVKKBDrvGMCUkuFXnow?key=RlGttIorZEntZNt64lpV-H5a" alt=""><figcaption></figcaption></figure>

#### 3. Choose the Query Method and Route Name

* Set the following options in the left pane:

  * **Method**: Select `Select` as the query method.
  * **Route Name**: By default, this will be the table name (e.g., `customers`), but you can customize it if needed.

  <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfyd_xALrjVDzbo1RgGQ6-vy2yXa2HnMIwsUqLGxY8YV0OgHN2q7efXo2w3I6xSyzjSEOEC7xWls2zEg6FuqS8C-JkhXSiLMqpXHeJQseQQJ15GrXe_0oFe7ElGtnqp-t2jhvkcLw?key=RlGttIorZEntZNt64lpV-H5a" alt="" width="188"><figcaption></figcaption></figure>

**4. Add Query Parameters (Optional)**

* You can define filters, joins, and additional query parameters as needed.
* For this example, we will proceed without extra query parameters.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd1Nbe6A1qtzoFp6k02-HI64yc12o37CTXIeu5qyCGbYsVGkaRiNnnfMoVFWUw8jNXhM3dVUbE9fBFUSEchge3EZm2ENeNoHhrOQkDiVd6pxkaBBxu3QSijz4QCx1eAXY9Wq55BIQ?key=RlGttIorZEntZNt64lpV-H5a" alt=""><figcaption></figcaption></figure>

#### 5. Save the API Endpoint

* Once configured, click on the **Save** button.
* Your API endpoint is now created successfully!

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc58PYZQ9NqrvGlByDB-hOzbmB-jgKR-LKfG5FMP34Bv9gMP7RYYE-vooUgFNNyYBKz7YZOrKJeIGBhBkUijlL5umurv5RpRQS1YisbbakvF1n8mQ6ICEPluqoJSotrPR0v_fLwbw?key=RlGttIorZEntZNt64lpV-H5a" alt=""><figcaption></figcaption></figure>

***

## Testing

1. **Open the Endpoint**:

   * In the left side pane, click on the API endpoint you just created.

   <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdjZ-28N2NA2a2aKJh_m5TsQJ9NgQZV4J1s9WDbxEXYKl4GvKbKmhfklQ62OKm316LH2j42oiu-44vxYRCptaAuPovO8CLENgo_t1BKx3j0Pk5fQ7Cpob0vtnD2uUPkII1Y837Jng?key=RlGttIorZEntZNt64lpV-H5a" alt=""><figcaption></figcaption></figure>
2. **Copy the Endpoint URL**:

   * Click on **Request** at the top-right corner to copy the endpoint URL to your clipboard.

   <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfBGEASxRbJdEtV8ILf7XNotyVowauuClW4XTeUthq8FAzPjJd8GDumSv2JYvzXol10GB9Hq0fPcF0OgGk-RvnM9Kl_07HQFF9eoVCMJ6j_4iRJvB_z0cmVW7lmfFt9PDqa4iozEQ?key=RlGttIorZEntZNt64lpV-H5a" alt=""><figcaption></figcaption></figure>
3. **Test the Endpoint in Postman**:

   * Open **Postman** (or any API testing tool).

   <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeGsBkgOlPF_hBlEgfrJdfkJArSmsyx-NEduuNXdoFFYzGA9EXOCX9KoPeGQlwZLc8PKZn_3HC8FlraWX6l6D-KOk_E23gxNqF77G7mJTDJb9nx90_Wizif01FsJLVVGYkk6M7Agw?key=RlGttIorZEntZNt64lpV-H5a" alt=""><figcaption></figcaption></figure>

* Paste the copied URL into the input field next to the request method.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf8hLhPpuqSUDfDu9BBcMA9K3O-WguaTJtnW-hNwpnUfb5uba6LI6uuPUGOrNu9fDXT9ngqmHV3JWneoYerM1YgcBj315rZf1SfJrwyXwpK9Y3RZ_S8MQkdrgMfMu94HkYcQO3g?key=RlGttIorZEntZNt64lpV-H5a" alt=""><figcaption></figcaption></figure>

* Ensure the request method is set to `GET` (default for a `Select` query).
* Click on the **Send** button.
* View the API response in the Postman interface.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeReSy4glXU--HSTn4WZmUccUa9dnsKUaZVN39z2sqtBI-Wg4ziYtb5cIJYtGzvdXnC26igOlH4V9ByE-ThJ4FsXAu-IrPcxZcJESZGKSS0OVCEOMNnLGgc97MDbtBgQtzWliDB?key=RlGttIorZEntZNt64lpV-H5a" alt=""><figcaption></figcaption></figure>

You have now successfully tested your first `Select` query!
