1
我在MySQL這個查詢,我需要將其轉換爲軌道活動記錄:轉換隻是MySQL查詢軌活動記錄
select p.*,x.* from
(select * from users ,roles_users
where users.id=roles_users.user_id and roles_users.role_id not in(2,3)) as P
left join
(select *
from cad_dispaths as T
where `startdate_dispatch` =
(select max(`startdate_dispatch`)
from cad_dispaths
where users_id = T.users_id)) x
on x.users_id = p.user_id
有沒有理由不能使用find_by_sql? – tehgeekmeister
idk whats find_by_sql。我想這就是我想要的...順便說一句,我可能需要軌道分頁 –
作出正確的答案,等一下。 – tehgeekmeister