teradata sql 用于省略 space
teradata sql for ommitting space
我正在处理一个 table 并且想要计算没有任何 space.
的列(学生姓名)的实例数
只喜欢 'SAM' 或“STAN”。
我的查询是:
select studentName
from loadbise.student
where studentName <>'% %'
and studentName is not null;
它 returns 列有 spaces。我错过了什么。
我正在处理不支持替换功能的旧版本 teradata (6.0)
您需要使用 'not like' 子句而不是 'not equal'。见下文。
select studentName
from loadbise.student
where studentName not like '% %'
and studentName is not null;
请参阅此 sql fiddle 以获取更多示例。此查询对于大型数据集可能效率很低,因此如果索引尚不存在,则在 studentName 列上插入索引可能会有所帮助。
我正在处理一个 table 并且想要计算没有任何 space.
的列(学生姓名)的实例数
只喜欢 'SAM' 或“STAN”。
我的查询是:
select studentName
from loadbise.student
where studentName <>'% %'
and studentName is not null;
它 returns 列有 spaces。我错过了什么。
我正在处理不支持替换功能的旧版本 teradata (6.0)
您需要使用 'not like' 子句而不是 'not equal'。见下文。
select studentName
from loadbise.student
where studentName not like '% %'
and studentName is not null;
请参阅此 sql fiddle 以获取更多示例。此查询对于大型数据集可能效率很低,因此如果索引尚不存在,则在 studentName 列上插入索引可能会有所帮助。