如何在cakephp中编写SQL查询? [英] how to write SQL Query in cakephp?
本文介绍了如何在cakephp中编写SQL查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
select campaign,lead_status,COUNT(id)
from buyers
where lead_status IN('Very Hot','Hot', 'Warm', 'Cold', 'Not Contacted')
and campaign IN('stage1','stage2','stage3','stage4') and created_on >='2012-10-01'
and is_put_for_exchange='0' and transaction_type='First Sale'
and propertytype='Residential'
group by campaign,lead_status
ORDER BY campaign asc, field(lead_status,'Very Hot','Hot', 'Warm', 'Cold', 'Not Contacted')
convert in cakephp语法plz It Argent