Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Location
    Kalamazoo
    Posts
    42

    Unanswered: Select statement and Unique

    Hi,
    I am trying to use the Select and Unique in one statement to check for unique values to be shown. I am using it as follows:
    Select * from {table name} where unique{column name}....This is not working.
    What I am trying to do is that- I want to delete records from a table when a specificed column has null in it!
    Please help!
    Thanks

  2. #2
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    In that case you run

    Select * from tablename where columnname='null' would return the rows with NULL values for that column.

    For detailed information on UNIQUE keyword refer to SQL books online.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  3. #3
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    Originally posted by Satya
    In that case you run

    Select * from tablename where columnname='null' would return the rows with NULL values for that column.

    For detailed information on UNIQUE keyword refer to SQL books online.
    I've never saw syntax like this columnname='null' for null value.
    Last edited by snail; 10-02-03 at 17:44.

  4. #4
    Join Date
    Sep 2003
    Posts
    8
    Originally posted by snail
    I've never saw syntax like this columnname='null' for null value.

    Try:
    Select * from table_name where column_name is NULL

Posting Permissions

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