Please point out why I am getting errors saying that my CTE columns are invalid. The following is my query.[code="sql"]with QuarterEarning as(select Top(2) Product, [Quarter One Earnings], Rank() over (order by [Quarter One Earnings] asc) as Earnings from dbo.Sales)select Product, [Quarter One Earnings] into ##Qtable from QuarterEarningselect ##Qtable.Product, ##Qtable.[Quarter One Earnings] from ##Qtable order by ##Qtable.[Quarter One Earnings] asc;[/code]
↧