OneToMany关系船舶上的Sql find lasted id

我刚刚了解了如何获得与这个reference相关的最新插入的id,在数据库中我有两个表channel_content_typechannel_plain_text_container,每个channel_plain_text_container行都引用了channel_content_typeid of channel_content_type上的content_id

这意味着channel_content_typechannel_plain_text_container上有更多的行,现在我如何在其中找到最新插入的id?

此sql命令不正确,返回no any row

SELECT ptext.id
FROM channel_content_type content
JOIN channel_plain_text_container ptext ON (content.id = ptext.content_id)
LEFT OUTER JOIN channel_content_type p2 ON (content.id = p2.id)
WHERE p2.id IS NULL

提前感谢

转载请注明出处:http://www.resmedchina.com/article/20230526/2617330.html