gpt4 book ai didi

php - 如何将嵌套 sql 查询转换为 zend 1.12 格式

转载 作者:行者123 更新时间:2023-11-29 12:02:11 26 4
gpt4 key购买 nike

我的查询:

select distinct ml.send_to from message_log as ml where NOT exists
(select mobile_no from user_details WHERE user_details.mobile_no = ml.send_to);

最佳答案

$select1 = $db->select()->from('user_details',array('mobile_no'))
->where('user_details.mobile_no = ml.send_to');

$select2 = $db->select()->distinct()
->from(array('ml'=>'message_log'), array('ml.send_to')))
->where('NOT EXISTS ?', $select1);

这将以最简单的方式实现这一点。

关于php - 如何将嵌套 sql 查询转换为 zend 1.12 格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32180679/

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