• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 421
  • Last Modified:

Sql syntax for square root

I have been asked to write this report that renders the square root of this formula.  I need help with the syntax to make this happen.  please the attached , the highlighted is what I need the code for .

Thanks in advance.
sqrt.jpg
0
tips54
Asked:
tips54
  • 4
  • 2
1 Solution
 
Scott PletcherSenior DBACommented:
SQL has a SQRT(<mathematical_expression>) function that can be used to get a square root.
0
 
tips54Author Commented:
Scott,  how would I write this equation in sql?
0
 
Ken ButtersCommented:
select sqrt((2*u*fix*365)/(fob*int+vol/rack*pallet_fob*obs)) from sometable;

assuming sometable has columns named

u
fix
fob
int
vol
rack
pallet
obs
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Scott PletcherSenior DBACommented:
Not sure I can fully read it, but, in SQL:

*=multiply
/=divide
+=add (obviously)
-=subtract (obviously)

Use parentheses to force sequence, as in normal math: SQL follows standard math rules -->  multiply/divide first, then add/subtract, in left to right order where otherwise equal.
0
 
tips54Author Commented:
I will try that Butter
0
 
tips54Author Commented:
ok
0
 
tips54Author Commented:
thanks .
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now