Home > Article > Backend Development > MYSQL AND OR条件问题
SELECT id,name FROM test WHERE type_1 = 1 OR type_2 = 1 AND id = 1
SELECT id,name FROM test WHERE (type_1 = 1 OR type_2 = 1) AND id = 1
SELECT id,name FROM test WHERE type_1 = 1 OR (type_2 = 1 AND id = 1)
SELECT id,name FROM test WHERE (type_1 = 1 OR type_2 = 1) AND id = 1