> For the complete documentation index, see [llms.txt](https://www.ducksql.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.ducksql.com/sql/undefined.md).

# 함수 사용하기

다양한 데이터 타입에 따른 함수 및 오퍼레이터를  제공합니다. 예를들어 숫자형의 경우 사칙연산, 텍스트형의 경우 문자열 길이 구하기등 동작을 할수 있습니다.

## 데이터 Type

대표적으로 많이 사용되는 데이터 형식은 아래와 같습니다.

* **INT, BIGINT** : 정수
* **Float, Double** : 소수점을 포함하는 숫자
* **TEXT, VARCHAR** : 텍스트
* **Timestamp** : 날짜 및 시간
* **Boolean** : 참 또는 거짓

{% hint style="info" %}
일반적인 경우 Type을 명시하지 않아도 동작하지만, Type이 필요한 경우 valu&#x65;**::int** 와 같이 Type을 명시할 수 있습니다.
{% endhint %}

## 숫자관련 함수

* 사칙 연산 : +, -, /, %
* ceil, floor, round&#x20;

## 텍스트 함수

* ||&#x20;
* left, right
* trim
* length
* lower, upper
* substr

## 날짜 함수

* \+ interval&#x20;
* date\_trunc
* date\_diff


---

# 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://www.ducksql.com/sql/undefined.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.
