R
R
rusgayfer2018-03-09 00:14:24
SQL
rusgayfer, 2018-03-09 00:14:24

How to output SQL query correctly?

I want to display data from the table so that the point (balance) is less than two, where zadaniya (tasks) are included, that is, they are equal to one
I do this, but it does not display correctly

SELECT * FROM `users` WHERE `point` < '2' OR `zadaniya` = '1'

How to withdraw correctly?
If I do this: Displays users whose balance is less than 2 points, but the tasks are 1 and 0, and I only need who = 1, that is, they are included
SELECT * FROM `users` WHERE `point` < '2'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-03-09
@rusgayfer

SELECT * FROM `users` WHERE `point` < '2' AND `zadaniya` = '1'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question