Quick Question about SQL Query Syntax

Discussion in 'Databases' started by Ascendancy, May 26, 2010.

  1. #1
    I am going through some source code on the Pligg CMS right now, and in one of the SQL queries I ran into this bit of logic:

    AND user_level<>"god";
    Code (markup):
    I get the general gist of this, the table value for user_level is relating to being equal to "god", but i'm not sure what the <> means. I assume it means "if user_level is NOT equal to 'god'", but I can't find any documentation on MySQL's website or through Google.
     
    Ascendancy, May 26, 2010 IP
  2. woods

    woods Peon

    Messages:
    228
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Correct, it's "not equal to". It's the same as typing != if you're more familiar with that.

    At least that's how it's been interpreted in every SQL server I've used so far :)
     
    woods, May 26, 2010 IP
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    (<>) = (!=)
     
    jestep, May 26, 2010 IP
  4. iimmdeepak

    iimmdeepak Peon

    Messages:
    208
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    ya on sql for not equal u can use both <> and !=
     
    iimmdeepak, Jun 10, 2010 IP
  5. ashu_sood08

    ashu_sood08 Peon

    Messages:
    125
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    in the sql we can use the both signs for not equal to like <> and != both are equivalend and do the same function
     
    ashu_sood08, Jun 10, 2010 IP