我有两个表(电影和性别)。
“性别”包含性别以及用于识别每个性别的 ID( Action = 1,戏剧 = 2...等);
Peliculas 包含许多列,其中包含信息以及用于标识电影性别的性别 ID。
我正在尝试进行年份在 xx 到 xx 年之间的选择(已完成),同时提出具有特定性别的电影。
我尝试过很多这样的事情:
select *
from pelicula p
where anio between 1995 and 1996
and select id
from genero g
where g.nombre = "Action" = p.genero_id;
最佳答案
尝试使用联接。
Select *
from pelicula p
Left Join genero g
p.genero_id = g.id
where anio between 1995 and 1996
and g.nombre = "Action";
关于mysql - SQL中的比较二比较,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58527816/