开发者

self join using cakephp

how can i write this sql query in 开发者_高级运维cakephp

select name from coupons as c where c.created=(select max(c2.created) from coupons as c2);


In this case, maybe you actually mean this:

$this->Coupon->find('first', array('order' => array('Coupon.created' => 'desc')));

For real subqueries, see the manual under Subqueries.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜