<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">If the underlying data type is numeric, you should really try to match using numeric operators:</p>

<pre style="background-color:#F7F7F7; border-radius:5px 5px 5px 5px; margin-left:15px; margin-right:15px; max-width:90vw; overflow-x:auto; padding:5px; color:black" bgcolor="#F7F7F7"><code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0" bgcolor="#F7F7F7"><span style="color: #008800; font-weight: bold">my</span> <span style="color: #996633">$foo_rs</span> <span style="color: #333333">=</span> <span style="color: #996633">$schema</span>
 <span style="color: #FF0000; background-color: #FFAAAA">   </span> <span style="color: #333333">-&gt;</span>resultset(<span style="background-color: #fff0f0">'Test'</span>)
 <span style="color: #FF0000; background-color: #FFAAAA">   </span> <span style="color: #333333">-&gt;</span>search
 <span style="color: #FF0000; background-color: #FFAAAA">   </span> ({
 <span style="color: #FF0000; background-color: #FFAAAA">   </span> <span style="color: #FF0000; background-color: #FFAAAA">   </span> col1 <span style="color: #333333">=&gt;</span> { <span style="background-color: #fff0f0">'&gt;='</span> <span style="color: #333333">=&gt;</span> <span style="color: #0000DD; font-weight: bold">23</span>, <span style="background-color: #fff0f0">'&lt;'</span><span style="color: #333333">=&gt;</span><span style="color: #0000DD; font-weight: bold">24</span> }
 <span style="color: #FF0000; background-color: #FFAAAA">   </span> })<span style="color: #333333">-&gt;</span>count;
</code></pre>



<p dir="auto">On 18 Aug 2017, at 13:29, Rajeev Prasad wrote:</p>

<p dir="auto"></p></div>
<div style="white-space:normal"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><p dir="auto">i found the solution:<br>
<br>
my $n = 33;<br>
<br>
my $foo_rs = $schema<br>
    -&gt;resultset('Test')<br>
    -&gt;search<br>
    ({<br>
        col1 =&gt; { like =&gt; '%.'.$n }<br>
    })-&gt;count;<br>
<br>
    On Friday, August 18, 2017 2:35 PM, Rajeev Prasad &lt;rp.neuli@yahoo.com&gt; wrote:<br>
<br>
<br>
 before i go an do some operations. i need to know if the following will work?<br>
<br>
so I have this column:<br>
col123.3323.4612.3310.3323.54623.11.33100.33<br>
<br>
I want to run two queries<br>
1. select all rows with 23 before decimal (not *23.*, just 23.*).<br>
my @foo = $schema    -&gt;resultset('Test')<br>
    -&gt;search<br>
    ({<br>
        col1 =&gt; { like =&gt; 23'.%'}<br>
    });<br>
    <br>
print "values @foo\n";<br>
<br>
I expect:23.3323.4623.54623.1<br>
2. second i want to run query to select for given value after decimal.my $foo_rs = $schema-&gt;resultset('Table')-&gt;search({<br>
                                                        col1 =&gt; { like =&gt; 23.'%' }});<br>
I expect:23.3312.3310.331.33100.33<br>
<br>
<br>
I get this error when i test:<br>
$ ./test.pl<br>
String found where operator expected at ./test.pl line 26, near "23'.%'"<br>
        (Missing operator before '.%'?)<br>
Possible unintended interpolation of @foo in string at ./test.pl line 29.<br>
syntax error at ./test.pl line 26, near "23'.%'"<br>
Global symbol "@foo" requires explicit package name (did you forget to declare "my @foo"?) at ./test.pl line 29.<br>
Execution of ./test.pl aborted due to compilation errors.<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
List: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class" style="color:#777">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class</a><br>
IRC: irc.perl.org#dbix-class<br>
SVN: <a href="http://dev.catalyst.perl.org/repos/bast/DBIx-Class/" style="color:#777">http://dev.catalyst.perl.org/repos/bast/DBIx-Class/</a><br>
Searchable Archive: <a href="http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk" style="color:#777">http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk</a></p>
</blockquote></div>
<div style="white-space:normal">
</div>
</div>
</body>
</html>