Thread: NOT vs != vs <>

    #1
  1. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,650
    Rep Power
    171

    NOT vs != vs <>


    Just need to confirm, these 3 are exactly the same:


    Code:
    WHERE
    NOT ( customers.name = 'A.Jones' )
    Code:
    WHERE customers.name != 'A.Jones'

    Code:
    WHERE customers.name <> 'A.Jones'
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,118
    Rep Power
    4274
    Originally Posted by zxcvbnm
    Just need to confirm, these 3 are exactly the same:
    yes, they are... in mysql

    but one of them will not work in all other database systems


    it took more than the usual three seconds to find the right search phrase in google, and this was among the resuts --

    http://stackoverflow.com/questions/7...-equal-in-tsql

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
  4. #3
  5. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,650
    Rep Power
    171
    Originally Posted by r937
    yes, they are... in mysql

    but one of them will not work in all other database systems
    Sometimes I wonder:

    Imagine a world with 1 type of AC adapter, 1 brand of computer where everythign is compatible with everything, 1 USB port, only php and not asp, not cold fusion, only mysql and not sql light, explode and not list and ....

    Not gonna happen.

IMN logo majestic logo threadwatch logo seochat tools logo