0
I am using the following query:
$sql = "SELECT * FROM `login` order by `account_id` ASC";
How do I add a constraint when account_id is 1 he "skip" and do not take the values of the line with account_id = 1?
0
I am using the following query:
$sql = "SELECT * FROM `login` order by `account_id` ASC";
How do I add a constraint when account_id is 1 he "skip" and do not take the values of the line with account_id = 1?
1
Say the ID can’t be 1
:
$sql = "SELECT * FROM `login` WHERE account_id <> 1 order by `account_id` ASC";
Assuming that Ids are all positive, it can also be so:
$sql = "SELECT * FROM `login` WHERE account_id > 1 order by `account_id` ASC";
Browser other questions tagged sql
You are not signed in. Login or sign up in order to post.
Perfect haha. I was trying to use php =! because I didn’t know the different symbol in MYSQL xD
– GGirotto
Mysql also accepts
!=
(as in PHP), but this would not work in other databases. Your attempt did not work because you reversed the order of characters!– bfavaretto
Aaaaa now I understand. Thank you very much :)
– GGirotto