gpt4 book ai didi

php - mysql select * from table where a 列值 = b 列值 laravel

转载 作者:行者123 更新时间:2023-11-29 18:11:30 24 4
gpt4 key购买 nike

我正在尝试查询一个表,其中包含名为“completed”的列和名为“follow_ups”的列以及其他列 - 使用 laravel 我正在尝试

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

使用 Laravel 模型运行以下命令

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

我不必使用 Laravels 模型系统,我也可以编写手动查询,但不确定查询应该是什么样子。有谁可以帮忙吗

最佳答案

您可以使用:

whereRaw(select * from table where completed > follow_ups)

关于php - mysql select * from table where a 列值 = b 列值 laravel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47361571/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com