由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - A simple question for SQL, seeking help
相关主题
关于SQL Server的string functionwhere can I download SQL Sever? thanks (null)
求教高手:odbc更新数据出错Re: How to concatenate NULL value with a string in SQL Server?
A SQL problemin DBMS, is NULL=NULL valid?
SQL的一个愚蠢小问题恢复SQL Server2000数据库(在线等)
一个奇怪的问题editting .sql file problem
加了EMAIL “IS NOT NULL”, 结果还是包括一些email "blank"的,帮忙分析How to get SQL help in sqlplus?
Questions on SQL[转载] Can anyone interpret this simple SQL?
seeking your cool idea怎么写这个Query,谢谢
相关话题的讨论汇总
话题: 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版参与讨论
相关主题
怎么写这个Query,谢谢一个奇怪的问题
#在SQL里啥子意思加了EMAIL “IS NOT NULL”, 结果还是包括一些email "blank"的,帮忙分析
誰來幫我開來開悄? Interesting SQL queryQuestions on SQL
包子请教queryseeking your cool idea
关于SQL Server的string functionwhere can I download SQL Sever? thanks (null)
求教高手:odbc更新数据出错Re: How to concatenate NULL value with a string in SQL Server?
A SQL problemin DBMS, is NULL=NULL valid?
SQL的一个愚蠢小问题恢复SQL Server2000数据库(在线等)
相关话题的讨论汇总
话题: sql话题: where话题: blank话题: lines