return 只包含没有空格的值的列

return the column that contains only value without white spaces

名称列包含 space.I 试图获取仅包含名称的列行,不应 return 空值和清空 values.But 它 return 包含的列白色 spaces。我试过了:

select name,id from details where name is not null;

以上查询return数据包含白色spaces。如何剔除其中包含白色space的数据?

尝试使用 NOT LIKE 语法;将您的查询更改为以下内容:

select name,id from details where name is not null and name not like '% %'

您可以查看 this 答案。

尝试trim函数:

select name,id from details where name is not null and trim(name) <> '';

这可能对你有用。

select name, id 
from details 
where name is not null and name !=""