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 '%@%' |