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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:21:44+00:00 2026-06-15T00:21:44+00:00

hi I have a table structure thus: mysql>DESC file; file_id fullpathname with records file_id

  • 0

hi I have a table structure thus:

mysql>DESC file;
file_id        
fullpathname   

with records

file_id | fullpathname                                         
--------+------------------------------------------------------
      6 | /var/tmp/4x4 and 6x4/test/test3.txt
      7 | /var/tmp/4x4 and 6x4/test/somefile
      8 | /var/tmp/4x4 and 6x4/test          
      9 | /var/tmp/4x4 and 6x4/6x4_1.JPG     
     10 | /var/tmp/4x4 and 6x4/6x4_2.JPG     
     11 | /var/tmp/4x4 and 6x4/4x4_2.jpg     
     12 | /var/tmp/4x4 and 6x4/4x4_1.jpg     
     13 | /var/tmp/dir/4x4 and 6x4               

and the query needs to be pretty much what I have below (but it’s not working)

SELECT * FROM file
WHERE fullpathname LIKE '/var/tmp/4x4 and 6x4%'
AND fullpathname NOT LIKE '/var/tmp/4x4 and 6x4/%/'

but it needs to NOT return the file_id 6 and 7 it needs to only select “paths” one node deep. It’s a weird one but this is the situation

what it should return is

file_id | fullpathname                                         
--------+------------------------------------------------------
      8 | /var/tmp/4x4 and 6x4/test          
      9 | /var/tmp/4x4 and 6x4/6x4_1.JPG     
     10 | /var/tmp/4x4 and 6x4/6x4_2.JPG     
     11 | /var/tmp/4x4 and 6x4/4x4_2.jpg     
     12 | /var/tmp/4x4 and 6x4/4x4_1.jpg     
     13 | /var/tmp/dir/4x4 and 6x4             
  • 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-15T00:21:45+00:00Added an answer on June 15, 2026 at 12:21 am

    Try this:

    SELECT * FROM file
    WHERE fullpathname LIKE '/var/tmp/4x4 and 6x4%'
    AND fullpathname NOT LIKE '/var/tmp/4x4 and 6x4/%/%'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an table structure like this mysql> SELECT id, name, parent_id FROM categories;
I have a MySQL database table with this structure: table id INT NOT NULL
I am using MySQL 5.0. I have table with following structure and data. CREATE
i have table structure with 3 colums (column1, column2, column3) and i want to
I have table structure: ous.txt 1452 1793 out.txt 36796 14997 ouw.txt 478 4247 3
I have this table structure on a SQL Server 2008 R2 database: CREATE TABLE
I have a table structure having a EMP_DATE column as below ID EMP_DATE ----
I have a table structure with columns like this [ID] [Name] [ParentId] [ParentName] The
I have some table structure: <tr class=row-2><tr> <tr class=row-3>..<tr> <tr class=row-4>..<tr> <tr class=row-5>..<tr> <tr
I have this table structure and would like to map it using Fluent Hibernate

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.