Home >Backend Development >PHP Tutorial >MYSQL AND OR条件有关问题
MYSQL AND OR条件问题
<br />SELECT id,name <br />FROM test <br />WHERE type_1 = 1 OR type_2 = 1 AND id = 1<br />
SELECT id,name <br />FROM test <br />WHERE (type_1 = 1 OR type_2 = 1) AND id = 1
SELECT id,name <br />FROM test <br />WHERE type_1 = 1 OR (type_2 = 1 AND id = 1)
SELECT id,name <br />FROM test <br />WHERE (type_1 = 1 OR type_2 = 1) AND id = 1