我有这样的查询。
select *
from tbl_post where id IN (select post_id from tbl_front_post
where section = 'shrestha' order by id desc)`
现在我想根据id
的{{1}}订购。
答案 0 :(得分:0)
您必须先加入两个表,然后才能根据tbl_front_post
进行订购select tbl_post.*
from tbl_post
left join tbl_front_post on tbl_front_post .post_id = tbl_post.id
where id IN (select post_id from tbl_front_post where section = 'shrestha')
oreder by tbl_front_post.id