Doing LIKE for a numeric column
-
Hello, In my table i have a column of type "bigint". i want to support two kind of filtering on that column. a "value" filter (>,<,=). and a "starts with" filter (i.e. "LIKE '44*'"). the first one is quite easy :) the second is unknown to me.... (i don't want to do it programmatically). any ideas?
-
Hello, In my table i have a column of type "bigint". i want to support two kind of filtering on that column. a "value" filter (>,<,=). and a "starts with" filter (i.e. "LIKE '44*'"). the first one is quite easy :) the second is unknown to me.... (i don't want to do it programmatically). any ideas?
Menny Even Danan wrote: i don't want to do it programmatically Why not? How are you doing the less than, greater than and equality filters without doing it programatically?
Do you want to know more? WDevs.com - Member's Software Directories, Blogs, FTP, Mail and Forums
-
Hello, In my table i have a column of type "bigint". i want to support two kind of filtering on that column. a "value" filter (>,<,=). and a "starts with" filter (i.e. "LIKE '44*'"). the first one is quite easy :) the second is unknown to me.... (i don't want to do it programmatically). any ideas?
Try this
where to_char(BIGINT_column,'999999999999') LIKE '44%'
But be prepared to possibly handle a huge number of records. :) Chris Meech I am Canadian. [heard in a local bar] Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden]