如何替换mysql5.7中的查询,因为mysql5.7不支持查询

时间:2019-06-18 01:50:58

标签: mysql database

我需要替换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

0 个答案:

没有答案
相关问题