关于#mysql语法错误#的问题,如何解决?

img


这句语法错误在哪,求告知!
select sno from where jno='j1'and pno in(select pno from p where color='红');

在这条MySQL语句中,出现语法错误的是:select sno from where jno='j1'and pno in(select pno from p where color='红'); ^^^^^^^^错误在于 from之后缺失表名。正确的语句应为:select sno from 表名 where jno='j1'and pno in(select pno from p where color='红');所以,完整正确的语句可以是:

select sno from 产品表 where jno='j1'and pno in(select pno from 零件表 where color='红');

select sno from product where jno='j1'and pno in(select pno from part where color='红');