Help with SQL query.
I need a query where
a particular column value is required as of a particular date whereas some of the other column values are required as of between two dates
e.g.
select t1.col1, t2.col2, SUM(col3)
from my_table1 inner join my_table2 on t1.id = t2.id
where [Date] between '2026-01-01' and '2026-02-11'
group by t1.col1, t2.col2
Now, I need another column i.e. col4 which required only as of a particular date
i.e. if I were to write a separate query it would be :
select t2.col4 from my_table1 inner join my_table2 on t1.id = t2.id
where [Date] = '2026-02-11'
Is there any way both of these could be achieved using a single query?
Any help would be much appreciated.