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 8556547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:22:38+00:00 2026-06-11T15:22:38+00:00

everyone; I am working on a database where path information are stored, one simplified

  • 0

everyone;

I am working on a database where path information are stored, one simplified table is shown below

path_id | path value
1         //a/b/c/d
2         //a/b/e
3         //a/b
4         //a/bcd

So here is the question, how can I get information where has ‘//a/b’ as the prefix? In this case, the result should be:

path_id | path value
1         //a/b/c/d
2         //a/b/e
3         //a/b

I am seeking for a more elegant and optimized query, other than using logic operators like ‘OR’.
Thanks.

  • 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-06-11T15:22:39+00:00Added an answer on June 11, 2026 at 3:22 pm
    SELECT * FROM YourTable WHERE path_value like '//a/b/%' OR path_value = '//a/b' 
    

    Note the extra slash before the wild card in the first part of the WHERE statement. This will exclude //a/bcd.

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

Sidebar

Related Questions

hey everyone... so i'm working on a database design class for university. I've got
First question here so hello everyone. The requirement I'm working on is a small
I am trying to do multiple counts everyone was working accept the first sub
Hello everyone i am working on a project which requires me to export some
Hey everyone, I'm working on a widget for Apple's Dashboard and I've run into
Good day everyone. I am working on a Firefox extension, and I want to
I've been working on my own django based blog (like everyone, I know) to
I'm working on an intranet MVC web application, using Fluent NHibernate. As everyone knows,
Hello and thanks to everyone for reading my question. I've been working on a
Hey everyone, just a quick thing, I have the hex to integer working, but

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.