i just learn about how can i get latest inserted id in relation ship with this reference, in database i have two table as channel_content_type
and channel_plain_text_container
, each channel_plain_text_container
row referenced to channel_content_type
with content_id
column on id
of channel_content_type
that means channel_content_type
have more row on channel_plain_text_container
as has many, now how can i find lastest inserted id in that?
this sql command is not correct and return 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
Thanks in advance