#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    7
    Rep Power
    0

    Why isnt this query working??


    select
    CASE
    when Name != ' '
    Then 'N'
    Else delete from table where Name=' '
    End

    from table

    im trying to delete a row from table where name is blank
    thanks for your help
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,280
    Rep Power
    4279
    Originally Posted by Biznez
    im trying to delete a row from table where name is blank
    Code:
    DELETE
      FROM daTable
     WHERE COALESCE(name,'') = ''
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo