Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6591859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:28:46+00:00 2026-05-25T17:28:46+00:00

I have an issue where I need to pass multiple criteria for a single

  • 0

I have an issue where I need to pass multiple criteria for a single field in SQL. For example if I was looking for all book titles which contained Ruby, PHP, or ASP.Net. Also, I only want to return a limited number of rows for pagination. I know I could do dynamic sql, but I am sure there is probably a better way. Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:28:47+00:00Added an answer on May 25, 2026 at 5:28 pm

    If you put your searchwords in a table it is not so hard.

    declare @criteria table(text1 varchar(20)) 
    declare @searchtable table(longertext varchar(2000)) 
    
    --lines wanted  
    declare @linefrom int
    declare @lineto int 
    
    set @linefrom = 1
    set @lineto = 2
    
    insert @criteria values('asp.') 
    insert @criteria values('ruby') 
    
    insert @searchtable values('bla bla ruby') 
    insert @searchtable values('bla asp. bla') 
    insert @searchtable values('ruby asp. bla') 
    
    ;with a as ( 
    select s.longertext, rn = row_number() over(order by longertext) from @searchtable s join @criteria c 
    on s.longertext like '%'+ c.text1+'%' 
    group by s.longertext 
    ) 
    select longertext from a 
    where rn between @linefrom and @lineto
    

    Result:

    bla asp. bla
    bla bla ruby
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an issue where I need to pass in query parameters for a
I have an issue where I need to pass the Session ID to a
We have an issue where we need to modify keys for users that are
I have a resource scheduling issue in Java where things need to be sequenced,
So here's my issue. I have an image that I need to shrink. The
I have an issue with using AWK to simply remove a field from a
I need to have a command handler for a ToggleButton that can take multiple
I have a HTML string in ISO-8859-1 encoding. I need to pass this string
I have a lot of JSON data I need to pass to a request:
I need some guidance with this issue I have. I have a navigational Controller,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.