1

I need help in building up one SQL query

My requirement is to get folders present in the path passed (Excluding subfolders)

When I pass the parameter like input : D245E7DA\Entertainment\

expected output:

D245E7DA\Entertainment\Movies\
D245E7DA\Entertainment\Series\

not expected this output:

D245E7DA\Entertainment\Movies\
D245E7DA\Entertainment\Series\
D245E7DA\Entertainment\Series\Ramayan
D245E7DA\Entertainment\Series\Geetha
2
  • You can also use stripping functions. Just remove all data after second "\" That should work. Commented Mar 26, 2020 at 8:15
  • Tag with the database you are using. Commented Mar 26, 2020 at 11:53

1 Answer 1

1

You can use like:

where folder like concat(<input>, '/%') and
      folder not like concat(<input>, '/%/%')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.