Groups | Blog | Home
all groups > inetserver asp db > november 2004 >

inetserver asp db : searched integer column


Bob Barrows [MVP]
11/11/2004 10:14:56 AM
[quoted text, click to view]
You should do one or the other. The resulting queries will be more
efficient. Avoid OR comparisons if at all possible.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

ben h
11/11/2004 5:09:08 PM
I have a basic page that returns a resultset of widgets (using an
integer identity field amongst others) that i want to provide a better
search for.

currently i allow the user to seach on description:
where widget_desc like '%text%'

i also want to allow search on the exact widget_id if they know it:
where widget_desc like '%text%'
or widget_id = 98

or if they don't:
where widget_desc like '%text%'
or widget_id <> 0 -- or something like this


i can do some asp script logic to use one or the other, but is there an
alternate way in the sql to do this? i think a case statement might be
the right direction, but i'm not sure about that.

AddThis Social Bookmark Button