我需要替换in查询,我的目的是区分两种注释,在演讲表中,有一行名为演讲模式,用于标识注释和弹幕这两种模式,这是我的目的。
我的sql代码如下。
select lecture_mode from lecture where id in (
select lecture_mode from lecture where id in (
select id from message inner join reply on message.id = reply.discuss_id
)
)
我的桌子是这样的
lecture table, store the course
lecture_mode the mode os a course
id (primary key) lecture's id
message table
id (foreign key from reply.discuss_id)
lecture_id (foreign key from lecture.id)
reply table
discuss_id