Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2007
    Location
    Columbia SC
    Posts
    81

    Unanswered: How to eliminate Space entries...?

    Hey,
    I have some field values entries in my database.. that are spaces like ' '. i wanna eliminate them.
    When i use IS NOT NULL in query it only eliminates the rows with NULL values so how could i modify the query to eliminate the rows with spaces in the field value..

    Thx in advance..

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    where COALESCE(somecolumn,' ')<>' '
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jul 2007
    Location
    Columbia SC
    Posts
    81
    Thank you very much sir..

  4. #4
    Join Date
    Apr 2007
    Posts
    183

    Lightbulb Easier?

    SELECT * FROM Table1 WHERE Col1 > ' '

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912

    Wink Less easy?

    Code:
    WHERE NULLIF(somecolumn,' ') IS NOT NULL
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •