|
|
-
paul.ramster Liked 9 Months ago through Pages
We wish to use these pages for publishing various documents, announcements, FAQ etc related to beyondrelational.com...
|
-
paul.ramster Commented 9 Months ago through Just Learned
select g.groupid
--, val
, sum(val)
, power(10,sum(log10(abs(val))))
* IsNull(NullIf((sum(IsNull(NullIf(sign(val),1),0)) % 2),0),1)
from @groups g
group by g.groupid
;...
|
-
paul.ramster Commented 9 Months ago through Just Learned
Your biggest problem is not the inaccuracy inherent in using floating point math - it's the error that arises when negative numbers are included.
You need to calculate the product of the absolute values, and then apply the correct sign. One way of doi...
|
-
paul.ramster Commented 2 Years ago through Just Learned
you can use brackets:
select * from @A A left join (@B B inner join @C C on B.b = C.c) on A.A = B.B
I think indentation can be more important than brackets to make SQL code readable, though......
|
-
paul.ramster Commented 2 Years ago through Just Learned
you can use brackets:
select * from @A A left join (@B B inner join @C C on B.b = C.c) on A.A = B.B
I think indentation can be more important than brackets to make SQL code readable, though......
|
-
paul.ramster Commented 2 Years ago through Just Learned
you can use brackets:
select * from @A A left join (@B B inner join @C C on B.b = C.c) on A.A = B.B
I think indentation can be more important than brackets to make SQL code readable, though......
|
-
paul.ramster Commented 2 Years ago through Blogs
There are two very basic coding errors in your example:
1. The loop has a WHILE condition that will never be satisfied, so loops infinitely.
2. The TOP operator is used without an ORDER BY clause, so the start condition is not defined.
Your WHI...
|
-
paul.ramster Commented 2 Years ago through Blogs
There are two very basic coding errors in your example:
1. The loop has a WHILE condition that will never be satisfied, so loops infinitely.
2. The TOP operator is used without an ORDER BY clause, so the start condition is not defined.
Your WHI...
|
-
paul.ramster Commented 2 Years ago through Blogs
Or, if you were a fan of the declarative approach, you could eliminate the loop...
;with cteTally as (
select Number
from (values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)) as t(Number)
)
select cast(@TestID as varchar(10)) + cast(sum(...
|
-
paul.ramster Commented 2 Years ago through Blogs
Or, if you were a fan of the declarative approach, you could eliminate the loop...
;with cteTally as (
select Number
from (values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)) as t(Number)
)
select cast(@TestID as varchar(10)) + cast(sum(...
|