MySQL
- 15 ответов
- 0 вопросов
7
Вклад в тег
select *
from FruitsTABLE f
where name = 'яблоко'
and exists (select *
from FruitTagTABLE t
where t.fruit = f.fruit
and f.tag = 'сладкий'
)
and exists (select *
from FruitTagTABLE t
where t.fruit = f.fruit
and f.tag = 'круглый'
)
select *
from table t1
where `id attrbute` = 1
and Значение = "Ель"
and exists (select * from table t2
where t1.`id product` = t2.`id product`
and t2.`id attrbute` = 2 and t2.Значение = 200)
and exists (select * from table t3
where t1.`id product` = t3.`id product`
and t3.`id attrbute` = 3 and t3.Значение = 10)