> For the complete documentation index, see [llms.txt](https://learnsql.gitbook.io/lernmysql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learnsql.gitbook.io/lernmysql/welcome-to-the-mysql-tutorial/untitled.md).

# Hàm nối chuỗi Concat trong MySql

Thông thường để nối chuỗi trong PHP thì chúng ta dùng dấu chấm (.), để nối chuỗi trong Javascript thì chúng ta dùng dấu cộng (+). Vậy để nối chuỗi trong MYSQL thì ta phải làm thế nào? Đơn giản là ta sẽ dùng hàm **Concat trong MYSQL** nhé các bạn.

### Hàm nối chuỗi Concat trong MYSQL <a href="#goto-h2-0" id="goto-h2-0"></a>

Hàm concat có tác dụng là nối các chuỗi lại với nhau với cú pháp như sau:

```
concat(str1, str2, str2, ... , strn)
```

```
select concat('freetuts','.net') as domain
Chạy lên kết quả sẽ là (domain => freetuts.net).
```
