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

Mar 19 2010 3:39AM by CAReitan   

Solution to TSQL Beginners Challenge 3

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 X (Nums, cnt, Factorial, lev)
AS
(
	SELECT 
		Nums,
		CASE Nums WHEN 0 THEN 1
		ELSE Nums END AS cnt,
		1,
		1
	FROM @Fact
	
	UNION ALL
	
	SELECT
		e.Nums,
		X.cnt,
		X.Factorial * (X.cnt +1 -X.lev),
		x.lev+1
	FROM @Fact e,X
	WHERE e.Nums=X.Nums AND X.Lev

Tags:


CAReitan
909 · 0% · 30
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]