Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.
DECLARE @ACCOUNT VARCHAR(10) DECLARE @YEAR VARCHAR(4) DECLARE @PERIOD VARCHAR SET @ACCOUNT = '90229' SET @YEAR = '2013' SET @PERIOD = '3' SELECT A.ACCOUNT, A.YEAR, A.PERIOD, A.BALANCE, (A.BALANCE + B.BALANCE) YTD_BALANCE FROM BALANCE A LEFT OUTER JOIN ( SELECT A.ACCOUNT, A.YEAR, A.PERIOD, SUM(A.BALANCE) BALANCE FROM BALANCE A WHERE A.ACCOUNT = @ACCOUNT AND A.YEAR = @YEAR AND A.PERIOD = @PERIOD ) B ON B.ACCOUNT = A.ACCOUNT AND B.YEAR = A.YEAR AND B.PERIOD = (A.PERIOD - 1) WHERE A.ACCOUNT = @ACCOUNT AND A.YEAR = @YEAR AND A.PERIOD = @PERIOD
|Make query more efficient||1||20|
|Sql Query: need to find records in table_a with no matches in table_b||14||35|
|How can I update a 2nd table with what is inserted into the 1st?||5||35|
|TSQL - How to declare table name||26||30|