I had reached out to everyone earlier today to ask for help, and I was able to take a lot away from that, so thank you in advance.
I'm looking to turn the query that I created into a "Temp Table".
I've searched far and wide on the internet and can find little to no literature on it.
Can anyone help me get started with creating a temp table?
The previous query was as follows:
SELECT A.Portfolio, B.PortfolioID, SUM(B.MarketValue) AS SumOfMV,
COUNT(B.SecID) AS [# of Securities]
From ERTutAccounts A
INNER JOIN ERTutPositions B ON A.PortfolioID = B.PortfolioID
GROUP BY A.Portfolio, B.PortfolioID
HAVING COUNT(B.SecID) > 70 OR SUM(B.MarketValue) > 30000000
Before attempting to build the above query into a temp table, I simply attempted a really trivial table to no avail. Can someone tell me what I'm doing wrong and the right place to begin?
CREATE TABLE #Test
INSERT INTO #Test (PortfolioID, Portfolio)
SELECT PortfolioID, Portfolio
WHERE PortfolioID = 1