Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MonthEndDate
- 2016-06-30 00:00:00.000
- 2016-07-31 00:00:00.000
- 2016-08-31 00:00:00.000
- 2016-09-30 00:00:00.000
- 2016-10-31 00:00:00.000
- 2016-11-30 00:00:00.000
- 2016-12-31 00:00:00.000
- MonthEndDate CustomerId Flag
- 2016-06-30 00:00:00.000 123 1
- 2016-07-31 00:00:00.000 123 1
- 2016-08-31 00:00:00.000 123 1
- 2016-09-30 00:00:00.000 123 1
- MonthEndDate CustomerId Flag
- 2016-06-30 00:00:00.000 123 1
- 2016-07-31 00:00:00.000 123 1
- 2016-08-31 00:00:00.000 123 1
- 2016-09-30 00:00:00.000 123 1
- 2016-10-31 00:00:00.000 123 0
- 2016-11-30 00:00:00.000 123 0
- 2016-12-31 00:00:00.000 123 0
- DECLARE @table1 TABLE
- (
- MonthEndDate DATETIME
- )
- INSERT INTO @table1
- VALUES('2016-06-30 00:00:00.000')
- INSERT INTO @table1
- VALUES('2016-07-31 00:00:00.000')
- INSERT INTO @table1
- VALUES('2016-08-31 00:00:00.000')
- INSERT INTO @table1
- VALUES('2016-09-30 00:00:00.000')
- INSERT INTO @table1
- VALUES('2016-10-31 00:00:00.000')
- INSERT INTO @table1
- VALUES('2016-11-30 00:00:00.000')
- INSERT INTO @table1
- VALUES('2016-12-31 00:00:00.000')
- DECLARE @table2 TABLE
- (
- MonthEndDate DATETIME
- ,CustomerId INT
- ,Flag INT
- )
- INSERT INTO @table2
- VALUES('2016-06-30 00:00:00.000',123,1)
- INSERT INTO @table2
- VALUES('2016-07-31 00:00:00.000',123,1)
- INSERT INTO @table2
- VALUES('2016-08-31 00:00:00.000',123,1)
- INSERT INTO @table2
- VALUES('2016-09-30 00:00:00.000',123,1)
- SELECt * FROM @table1
- SELECt * FROM @table2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement