boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - A simple question for SQL, seeking help
相关主题
关于SQL Server的string function
求教高手:odbc更新数据出错
A SQL problem
SQL的一个愚蠢小问题
一个奇怪的问题
加了EMAIL “IS NOT NULL”, 结果还是包括一些email "blank"的,帮忙分析
Questions on SQL
seeking your cool idea
where can I download SQL Sever? thanks (null)
Re: How to concatenate NULL value with a string in SQL Server?
相关话题的讨论汇总
话题: sql话题: where话题: blank话题: lines
进入Database版参与讨论
1 (共1页)
i****i
发帖数: 18
1
I got a csv file from vedor with only Emails.
There is a blank line on top of each email address. I tried to remove the
blank lines in SQL server. I imported the CSV file to dbtemp.
I tried to write a SQL query
SELECT *
FROM table
WHERE (EmailAddress IS NOT NULL)
but it still pulls out every lines including the blank lines. Not sure what
is the problem.
example:
EmailAddress
0*********[email protected]
0*********[email protected]
1********[email protected]
1******[email protected]
a9
发帖数: 21638
2
and trim(emailaddress) <> '' ?

what

【在 i****i 的大作中提到】
: I got a csv file from vedor with only Emails.
: There is a blank line on top of each email address. I tried to remove the
: blank lines in SQL server. I imported the CSV file to dbtemp.
: I tried to write a SQL query
: SELECT *
: FROM table
: WHERE (EmailAddress IS NOT NULL)
: but it still pulls out every lines including the blank lines. Not sure what
: is the problem.
: example:

g***l
发帖数: 18555
3
delete from table where rtrim(ltrim(emailaddress))=''
delete from table where emailaddress not like '%@%'
i****i
发帖数: 18
4
Thank you very much A9 and gejkl
Both work well.
WHERE ltrim(rtrim(EmailAddress)) <> ''
WHERE ltrim(rtrim(EmailAddress)) LIKE '%@%'
1 (共1页)
进入Database版参与讨论
相关主题
Re: How to concatenate NULL value with a string in SQL Server?
in DBMS, is NULL=NULL valid?
恢复SQL Server2000数据库(在线等)
editting .sql file problem
How to get SQL help in sqlplus?
[转载] Can anyone interpret this simple SQL?
怎么写这个Query,谢谢
#在SQL里啥子意思
誰來幫我開來開悄? Interesting SQL query
包子请教query
相关话题的讨论汇总
话题: sql话题: where话题: blank话题: lines