例如:
从表中选择 *,其中 a&b = b;
我已经尝试过
where([ ['a'&$b, $b] ])->get();
和 where([ [['a', '&', $ b], $b]])->get();
他们都失败了。
a
是列,$b
是变量。
最佳答案
您可以使用whereRaw
whereRaw('a&b = b')->get();
关于php - 如何在 Laravel 数据库查询中使用按位运算符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46627430/