Add restriction MYSQL

0

I'm using the following query:

$sql = "SELECT * FROM 'login' order by 'account_id' ASC";

How do I add a constraint when account_id is equal to 1 it "jumps" and does not catch the values of the line with account_id = 1?

    
asked by anonymous 25.03.2015 / 13:32

1 answer

1

Say that the ID can not be 1 :

$sql = "SELECT * FROM 'login' WHERE account_id <> 1 order by 'account_id' ASC";

Assuming the IDs are all positive, it can also look like this:

$sql = "SELECT * FROM 'login' WHERE account_id > 1 order by 'account_id' ASC";
    
25.03.2015 / 13:33