---
title: "SQL String Functions 8 Top SQL Queries"
description: "Eight top SQL string functions for smart SQL developers to write better queries. Useful to read now."
url: https://srinimf.com/2019/04/07/string-functions-useful-for-smart-sql-queries/
date: 2019-04-07
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2019/04/pexels-photo-6567563.jpeg?fit=1880%2C1253&ssl=1
categories: ["SQL"]
tags: ["SQL tips and tricks", "String functions for smarties"]
type: post
lang: en
---

# SQL String Functions 8 Top SQL Queries

Here are eight top SQL string functions. These include Length, TRIM, Concatenate, Trailing, CHAR, LPAD, RPAD, and Soundex.

## **SQL String functions**

1. Length Function
2. TRIM functions
3. Concatenate function
4. Trailing Function
5. CHAR function
6. LPAD
7. RPAD
8. Soundex

### **[How to](https://srinimf.com/2017/04/11/this-is-why-replace-function-is-so-famous/) Use Built-in String Functions**

**#1 Length**

```
Select LENGTH (first_name) 
from my_employee;
```

The above query counts the FIRST_NAME of all characters that include spaces.

**#2 TRIM**

```
Explained with examples of [TRIM function](https://srinimf.com/2012/07/04/db2-sql-ltrim-rtrim-and-trim/)s.
```

**#3 Concatenate**

```
Select first_name 
|| last_name 
from my_employee;
```

**#4 Trailing Functions**

```
Select Trim (trailing 
'y' from first_name) 
from my_employee;
```

Trailing is case-sensitive.

**#5 CHAR Function**

```
Here are the best examples of the [CHAR function you can find here.](https://srinimf.com/2020/06/28/how-to-create-a-view-to-format-dates/)
```

**#6 and #7 LPAD and RPAD**

```
You can find here [examples for RPAD and LPAD](https://docs.oracle.com/cd/B28359_01/olap.111/b28126/dml_functions_2017.htm)
```

**#8 Soundex**

```
Select Soundex(first_name) 
from my_employee;
```

The above example converts ‘Srinimf’ into an Alpha-numeric value.

**Audio Post**

**Related Posts**

- [LOCATE Function for Use in SQL Queries](https://srinimf.com/2014/09/04/db2-functions-posstr-and-locate/)
- [UPPER and Lower Functions in any SQL](https://www.biganalytics.me/2019/04/examples-sql-functions.html)
- [LPAD and RPAD functions](https://docs.oracle.com/cd/B28359_01/olap.111/b28126/dml_functions_2017.htm)

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2019%2F04%2F07%2Fstring-functions-useful-for-smart-sql-queries%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2019%2F04%2Fpexels-photo-6567563.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=SQL%20String%20Functions%208%20Top%20SQL%20Queries)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2019/04/07/string-functions-useful-for-smart-sql-queries/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2019/04/07/string-functions-useful-for-smart-sql-queries/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2019/04/07/string-functions-useful-for-smart-sql-queries/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2019/04/07/string-functions-useful-for-smart-sql-queries/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20SQL%20String%20Functions%208%20Top%20SQL%20Queries&body=https%3A%2F%2Fsrinimf.com%2F2019%2F04%2F07%2Fstring-functions-useful-for-smart-sql-queries%2F&share=email)
-

### Like this:

Like Loading…
