SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 "Power Of" in SQL?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

matta0990
Starting Member

United Kingdom
44 Posts

Posted - 07/03/2012 :  08:56:13  Show Profile  Reply with Quote
Is there a way i can do a 'Power Of' calculation in SQL? If so can i have an example please.

Thanks,
Matt

robvolk
Most Valuable Yak

USA
15568 Posts

Posted - 07/03/2012 :  09:29:16  Show Profile  Visit robvolk's Homepage  Reply with Quote
If you mean exponentation:

SELECT POWER(10,3) -- 1000

If you mean the root of a number in another number's base:

SELECT LOG(1000)/LOG(10) -- returns 3 (10^3)
SELECT LOG(1024)/LOG(2) -- returns 10 (2^10)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000