社区
MS-SQL Server
帖子详情
SQL中怎么计算立方根?
bsd
2003-12-01 10:23:12
请高手指点,谢谢!
...全文
660
5
打赏
收藏
SQL中怎么计算立方根?
请高手指点,谢谢!
复制链接
扫一扫
分享
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
bsd
2003-12-01
打赏
举报
回复
抱歉各位,偶已经结帖了,下次有机会再给各位加分吧。
to klan,
引自SQL联机手册:POWER 函数返回所给数字表达式值的指定次幂的值。POWER(2,3) 返回 2 的 3 次幂,即 8。可以指定负数幂次,所以 POWER(2.000, -3) 返回 0.125。请注意,POWER(2, -3) 的结果是 0,这是因为返回的结果与所给数字表达式的数据类型相同。因此,如果结果有三位小数,则计算其所给幂次的数字必须也有三位小数。
Rotaxe
2003-12-01
打赏
举报
回复
没有直接的函数。可以间接计算
case when 变量>0
exp(log(变量))
when 变量=0
0
when变量<0
-exp(log(变量))
klan
2003-12-01
打赏
举报
回复
power函数好像支持不好分数或者小数的幂,但是power(25,0.5)是对的,而power(27,1.0/3.0)就不对了,奇怪~~
关注
victorycyz
2003-12-01
打赏
举报
回复
declare @a numeric
select @a=power(216.0,1.0/3.0)
select @a
这样就可以了!
victorycyz
2003-12-01
打赏
举报
回复
declare @a numeric
select @a=power(216,1.0/3.0)
select @a
试了一下,结果不是6,而是5,不知为什么?
LeetCode38——Count and Say
LeetCode38——Count and Say 上一题对我来说实在太凶残了,所以我还是缓缓先做38题好了。。。 题意: 可以理解为求一个数组的第n项,而这个数组的通项公式可以这样理解: 第1项:1 第2项:11 第3项:21 第4项:1211 第5项:111221 第6项:312211 ... ... 第n项:第n-1项的数字串从左到右读出来。
Leetcode1-100: 38. Count and Say
Leetcode1-100: 38. Count and Say问题描述解题思路代码实现 问题描述 题目要求: 输入一个数字,输出这个数字代表的count-and-say字符串,注意每个数字对应的字符串需要根据上一个数字的字符串来得出(例如4对应的是1211,就是1个1,1个2,2个1,所以5对应的字符串就是111221) 解题思路 比较简单,直接brute force,迭代从1往后解,每次把上一个的结果最后下一个的输入来做即可。 代码实现 public String countAndSay(int n)
[Leetcode] Count and Say
class Solution { public: string countAndSay(int n) { // Start typing your C/C++ solution below // DO NOT write int main() function string s = "1"; for (int
LeetCode 38 -- Count and Say
LeetCode 38 -- Count and Say The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11. 11 is read off as
LeetCode - 38. Count and Say(36ms)
LeetCode - 38. Count and Say(36ms) The count-and-say sequence is the sequence of integers with the first five terms as following: 1....
MS-SQL Server
34,876
社区成员
254,635
社区内容
发帖
与我相关
我的任务
MS-SQL Server
MS-SQL Server相关内容讨论专区
复制链接
扫一扫
分享
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章