[英]Length (column) greater than but spaces after the characters
I have this query to show all records where column is greater than 4 characters, however, the data contains spaces after the characters for example '1234 ' . 我有这个查询来显示列大于4个字符的所有记录,但是,数据在字符之后包含空格,例如'1234'。
How could I modify the below query to ignore the spaces after the characters? 如何修改以下查询以忽略字符后的空格? Querying an Oracle database.
查询Oracle数据库。
Many thanks. 非常感谢。
select *
from tablename
where length(field1) > 4
You can use rtrim
function to remove the trailing spaces. 您可以使用
rtrim
函数删除尾随空格。
select *
from tablename
where length(rtrim(field1)) > 4
Perhaps you want to check ltrim
, trim
functions, too. 也许您也想检查
ltrim
, trim
功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.