Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

This challenge though does not have any resemblance with the real time problem directly, but it measures about logical thinking. The problem is all about finding the factorial of numbers

TSQL Beginners Challenge 3 - Find the Factorial

Solution to TSQL Beginners Challenge3

Feb 24 2011 12:15AM by Dineshrajan   

Solution to TSQL Beginners Challenge 3

Hi,

This is my solution. 

DECLARE @Fact TABLE(Nums INT)
INSERT INTO @Fact 
SELECT 0 UNION ALL 
SELECT 1 UNION ALL 
SELECT 3 UNION ALL 
SELECT 5 UNION ALL 
SELECT 10

SELECT * FROM @Fact

;WITH CTE(Number,Fact )
AS
(
	SELECT 1,CAST(1 AS BIGINT)
	
	UNION ALL
	
	SELECT Number+1,CAST(Fact*(Number+1) AS BIGINT)
	FROM
	CTE  
	WHERE Number<20
)

SELECT * FROM CTE C
JOIN @Fact F ON C.Number = F.Nums

Tags:


Dineshrajan
539 · 0% · 68
0
Liked



Submit

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]