2017-11-18 168 views
0

林试图查询与列的表中调用完成和列称为follow_ups其他列中 - 使用laravel IM使用laravel模型试图MySQL的SELECT * FROM表,其中列中的值=列b值laravel

select * from table where completed > follow_ups 
select * from table where completed = follow_ups 

IM运行以下

$followUps = TestFollowups::where('follow_ups', '>', 'completed')->get(); 

我没有使用laravels模型系统,我可以写一本手册查询,以及,但不确定查询应该是什么样子。任何人都可以帮助请

+2

https://stackoverflow.com/questions/30331437/laravel-eloquent-compare-column-values –

+0

谢谢这正是我需要的 – Yeak

回答

0

您可以使用:

whereRaw(select * from table where completed > follow_ups) 
相关问题