Re: Simulating wildcard for Numeric database types



On Apr 27, 8:46 am, goykhmanster <goykhmans...@xxxxxxxxx> wrote:
Hi

I have a query that is expecting multiple numeric parameters, and I am
trying to make it generic enough so that if any of these numeric
parameters is not provided, i can still execute the query and get all
matches as if i'm using '%' for a Varchar parameter.

I'm not saying this is right, optimal or good, but I use:

where mySearchValue = -1 or my_column = mySearchValue

If the search value is -1 (or whatever default you choose) then the
records are not filtered. If the search value is not the default, then
the records are filtered.

Granted, I haven't used it with massive queries but it seem to work
alright.

C>

.



Relevant Pages