有时候在进行数据库查询的时候会用到union查询,但是查询的时候会发现两个limit只有一个是有效的,如下查询 select * from table where status = 0 limit 10 union select * from table where status = 1 limit 30 这样的语句实际的查询效果是这样的,如下: (select * from table where status = 0 limit 10) union (select * from table…
// WHERE name = 'dogstar' AND age = 18 $user->where(array('name' => 'dogstar', 'age' => 18)) // WHERE name = 'dogstar' OR age = 18 $user->or('name', 'dogstar')->or('age', 18) // WHERE ((name = ? OR id = ?)) AND (note = ?) -- 'dogstar', '1',…