For example I need to reuse a condition like this:
e.exampleTableDate between '2018-01-01' and '2018-01-10'
In multiple places in the text. Is it possible to put this query in some kind of a placeholder in the beginning and change just that to change it everywhere.
I guess I could just replace the text everywhere, but at this point I'd like to know if this is even possible. Are there things like placeholders and variables in this context in SQL?
ADDITIONAL EXAMPLE:
select
c.name,
(
select distinct id
from x
left join y
where
condition 1,
condition 2,
**repeating condition**
) [stuff 1],
(
select distinct id
from x
left join y
where
condition 1,
condition 2,
condition 3,
**repeating condition**
) [stuff 2],
(
select distinct id
from x
left join y
where
condition 1,
**repeating condition**
) [stuff 3]
from country c
order by c.name