Я получил запрос, как это, его работы, как это должно работать, но я задаюсь вопросом, как сделать это в одном запросеИзменить Sub Query
SELECT
(
Select count(exists)
from country c
join special s ON c.id_special = s.id
join raports rap ON c.id = rap.id_raport
where c.id_document = 7 and exists = 1
and rap.id_data = 201501 and is_id = 1
) as number_of_ID_in_table_exists,
(
Select count(sps)
from country c
join special s ON c.id_special = s.id
join raports rap ON c.id = rap.id_raport
where c.id_document = 7 and sps = 1
and rap.id_data = 201501 and is_id2 = 1
) as number_of_ID2_in_table_exists;
См. Http://meta.stackoverflow.com/questions/333952/why-should-i-provide-an-mcve-for-what-seems-to-me-to-be-a-very-simple-sql- запрос – Strawberry
Спасибо, у меня будет это в следующий раз. – Buckethead