|
|
-
Zibi Commented 12 Months ago through Blogs
Hello,
so below two more generic solutions based on tally table. The first in pure sql, second with a little xml support. Solutions base on normalisation (converting to decimal) and comparing (text or float). Both solutions are single queries.
<pre cl...
|
-
Zibi Commented 12 Months ago through Blogs
Hello,
not happy with data like below
<pre>
set @s= '2.202 3.0 31'
returns:
2.2020 30 4.0000 2.202 3.0 31
2.202000 30 4.0000 2.202 3.0 31
and should return nothing
</pre>...
|
-
Zibi Commented 12 Months ago through Blogs
Hello,
another approuch using xml (splitting numbers, normalizing and creating key from them - those action perform in searched string and in the table. Next seeking prepared key in the table)
regards
Zibi
<pre class="brush:plain">
;with cte01...
|
-
Zibi Liked 12 Months ago through Pages
We wish to use these pages for publishing various documents, announcements, FAQ etc related to beyondrelational.com...
|
-
Zibi Commented 12 Months ago through Blogs
Hello,
next approuch
regards
Zbigniew
<pre class="brush:plain">
select [sum_of_digits]=cast(cast(
cast(replicate('<b></b>',len(@i))+'<a>'+cast(@i as varchar)+'</a>' as xml).query(
...
|
-
Zibi Commented 12 Months ago through Blogs
Hello,
another xml approuch
regards
Zbigniew
<pre class='brush: plain'>
declare @i int, @sql varchar(8000)
set @i=798273
select [sum_of_digits]=cast(
cast(
cast('<a>'+cast(@i as varchar...
|
-
Zibi Commented 12 Months ago through Blogs
Hello, this below is proof of such errors
<pre class='brush: plain'>
select [sum_of_digits]=
cast(replace(cast(cast(
replace(
replace(
replace(
replace(
replace(
...
|
-
Zibi Commented 12 Months ago through Blogs
<P><STRONG>Method 4 : Using xml (without variables)</STRONG></P>
<pre class='brush: plain'>
select [sum_of_digits]=
cast(cast(cast(
replace(
replace(
replace(
replace(
replace(
...
|
|
|
|
|