Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to query for a column with white spaces only? 1

Status
Not open for further replies.

lcs01

Programmer
Aug 2, 2006
182
US
A column with varchar type and NULL allowed. How do I write a sql so that I can retrieve the records with unknown number of white spaces only?

Thanks for your help.
 
You mean empty values???

Select mycolumn from mytable where mycolumn=" ";

or NULL values:

Select mycolumn from mytable where mycolumn is NULL;


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thank you, r937. That's the one I am looking for.

To vacunita, than you for your response. I am trying to query a column with 1+ white spaces only.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top