I am querying 2 independent tables but related data.
The query is as follows:
select STDEV(M1.[Close]) as M1, STDEV(M2.[Close]) as M2 from M1, M2;
I want to show 2 standard deviation data on separate columns.
But SQL Server hangs there and stops moving. Why is that? It is a very simple query.
How can I do so without crossing 2 tables? The tables are huge.
you can use this.
SELECT (SELECT STDEV(M1.[Close]) from M1) as M1 , (SELECT STDEV(M2.[Close]) from M2) as M2;