Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Query Question

$
0
0

Hello All,

DECLARE @TEMP TABLE
(
	Calls	INT,
	DT		DATE
)

INSERT INTO @TEMP VALUES ( 10, '2013-05-18' )
INSERT INTO @TEMP VALUES ( 5, '2013-05-28' )
INSERT INTO @TEMP VALUES ( 5, '2013-06-15' )

SELECT	Calls, DT
FROM	@TEMP

Expecte o/p:-

SELECT	'10' AS Calls, '2013-05-18' AS DT
UNION ALL
SELECT	'5' AS Calls, '2013-05-28' AS DT
UNION ALL
SELECT '15' AS Calls, 'May MTD' AS DT
UNION ALL
SELECT	'5' AS Calls, '2013-06-18' AS DT
UNION ALL
SELECT '5' AS Calls, 'June MTD' AS DT

Thanks

Kumar


Please do let us know your feedback. Thank You - KG, MCTS


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>