Sorry if the title isn't clear enough. This is my query:
SELECT
'>200000 €' as amount,
Q1.asset as inbound,
Q2.asset as outbound,
Q3.asset as inside
FROM
(
SELECT COUNT(amount* base_rate) as asset
FROM user_wallet_movement
WHERE status = 'execute'
AND direction = 'inbound'
AND to_address is null
AND mov_date > '2020-01-07'
AND mov_date < '2021-06-30'
AND amount* base_rate > 200000
) AS Q1
JOIN
(
SELECT COUNT(amount* base_rate) as asset
FROM user_wallet_movement
WHERE status = 'execute'
AND direction = 'outbound'
AND to_address is null
AND mov_date > '2020-01-07'
AND mov_date < '2021-06-30'
AND amount* base_rate > 200000
) AS Q2
JOIN
(
SELECT COUNT(amount* base_rate) as asset
FROM user_wallet_movement
WHERE status = 'execute'
AND to_address is not null
AND mov_date > '2020-01-07'
AND mov_date < '2021-06-30'
AND amount* base_rate > 200000
) AS Q3
as you can see, I'm joining three queries which have some conditions in common. My question is: Is it possible to write only once the common conditions?