在SQL中获取字符串的长度 [英] Getting the length of a string in SQL

查看:138
本文介绍了在SQL中获取字符串的长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取SQL中字符串的长度(使用Firebird 2.x +版本).每当我选择一个字符串的长度时,它都会给我该字符串的实际分配的最大长度,而不是获取记录中记录了多少个字符的长度,如您在此处看到的:

I'm trying to get the length of a string in SQL (using Firebird version 2.x+). Whenever I select the length of a string it gives me the actual assigned maximum length of that string as opposed to getting the length of how many of the characters are taken in a record, as you can see here:

您可以想象,这对我没有帮助,因为我无法按长度排序,因为我试图按已分配了恒定长度的属性进行排序.

as you can imagine, this does not help me, as I can't order by the length, since I'm trying to order by an attribute that has a constant length assigned.

我将如何实现自己想要实现的目标?那就是:获取一个字符串中包含多少个字符的长度.

How would I achieve what I am trying to achieve? That is: getting the length of how many characters are taken in a string.

推荐答案

针对

注释

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆