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

  • Home
  • SEARCH
  • 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 6029993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:58:13+00:00 2026-05-23T04:58:13+00:00

My current query (doesn’t work) SELECT url FROM table WHERE ‘http://www.longurl.com/some/string’ like ‘%’ .

  • 0

My current query (doesn’t work)

SELECT url
FROM table
WHERE
    'http://www.longurl.com/some/string' like '%' . url . '%'

table

url
longurl.com

I am trying to match the record in “table” for longurl.com to any compared URL that contains longurl.com.

Should match compared URLs such as:

http://www.longurl.com/some/string
http://longurl.com
http://longurl.com/some/string

In this PHP example, it is very easy to compare:

$url = "http://www.longurl.com/some/string";    
if(strstr($url, 'longurl.com')) {
    echo "success";
} else {
    echo "failure";
}
  • 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-23T04:58:14+00:00Added an answer on May 23, 2026 at 4:58 am

    Okay, what about:

    SELECT url 
      FROM table 
     WHERE INSTR('http://www.longurl.com/some/string', url) > 0
    

    (Formatting didn’t work so well in the comments, so I added it again as an answer.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to fetch a variable address from my current URL using JRequest::getVar('address')
I currently have this query set-up: SELECT topic.content_id, topic.title, image.location FROM mps_contents AS topic
IQueryable<double?> query = (from t in ctx.MyList orderby t.MyNums select t.MyNums).Take(1); IQueryable<double> q2 =
This is how I have my current query setup: SELECT * , ( SELECT
I have an SQL query I get from a configuration file, this query usually
I'm trying to perform a select query over two tables, one containing, for example,
I know that question doesn't make much sense, but here goes: Times Table Authority
On my current project I'm using SQL CE. Since it doesn't have support for
I'm trying to get around pulling all the data from a table, and cycling
Current function to run mysql query in PHP and displays error on screen when

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.