Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不知道如何将这个“MAX”与 ORM 一起使用。使用 Kohana 3.2。
SELECT MAX( version_id ) AS latest FROM pages_versions WHERE page_id = 3
ORM::factory('pages_version') ->select(array(DB::expr('MAX(version_id)'), 'max_version')) ->where('page_id', '=', '3') ->find_all()