MySQL- if conditon fails (#1064 error) I have the following query:

SELECT 
    CONCAT(user1.name, ' ', user2.name)
    IF(user1.salary &lt; user2.salary) as userSalary
FROM `users` AS user1
LEFT JOIN users AS user2 ON user1.id = user2.id
ORDER BY user1.salary ASC


I am trying to find all users which have a lower salary than the next user (in the same table). The table has a simple structure:

Fields:

ID (PK) | name | age | address | salary


This is the error I am getting at the moment:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF(user1.sallary &lt; user2.sallary) as userSallary
FROM `users` AS user1
LEFT JO' at line 3


What am I doing wrong here?
Please have a look at IF statement at MySql Docs


  IF search_condition THEN statement_list
      [ELSEIF search_condition THEN statement_list] ...
      [ELSE statement_list] END IF  


Or at IF() function:

IF(expr1,expr2,expr3)

If expr1 is TRUE (expr1 &lt;&gt; 0 and expr1 &lt;&gt; NULL), 
IF() returns expr2. Otherwise, it returns expr3.


Your sentence should be something similar to:

SELECT 
    CONCAT(user1.name, ' ', user2.name)
    IF(user1.salary &lt; user2.salary, user1.salary, user2.salary) as userSalary
FROM `users` AS user1
LEFT JOIN users AS user2 ON user1.id = user2.id
ORDER BY user1.salary ASC