0

Combining AND & OR

Error Message: ERROR: syntax error at or near "order" LINE 1: order by price ^ Code: select * from orders where price >400 and (distance <10 or age >40); order by price; I have tried to look through the previous lessons for answers and I do excactly as they did for when order by was shown in lesson. Now I am so confused at what is even wrong

17th Sep 2021, 8:49 AM
Marc8539
Marc8539 - avatar
3 Antworten
+ 2
Semicolon before oder statement should not come The semicolon should be at the end of the statement only select * from orders where price > 400 and (distance < 10 or age > 40) order by price;
17th Sep 2021, 8:53 AM
Niththish
Niththish - avatar
+ 2
Marc8539 it often happens for a programmer 🙂
17th Sep 2021, 9:33 AM
Niththish
Niththish - avatar
0
Oh my that was honestly a dumb mistake, how was I confused for so long about that
17th Sep 2021, 9:21 AM
Marc8539
Marc8539 - avatar