Unix Technical Forum

Best query for a path or parts thereof

This is a discussion on Best query for a path or parts thereof within the MySQL forums, part of the Database Server Software category; --> Hi, I want to search for my current directory or parents of my directory. So if my path is, ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 11:29 AM
FFMG
 
Posts: n/a
Default Best query for a path or parts thereof


Hi,

I want to search for my current directory or parents of my directory.
So if my path is, http://www.example.com/patha/pathb/

my path is '/patha/pathb/'

I could do
SELECT * FORM TABLE A WHERE path='/patha/pathb/'
SELECT * FORM TABLE A WHERE path='/patha/'

or even

SELECT * FORM TABLE A WHERE path='/patha/pathb/' OR path='/patha/'

but I was wondering if there was a better, more efficient way of doing
it?
How would you design the table for such a path?

The 'path' is unique and there is only ever one of each, (but there
could be an entry for '/patha/pathb/' and '/patha/'

Thanks

FFMG


--

'webmaster forum' (http://www.httppoint.com) | 'Free Blogs'
(http://www.journalhome.com/) | 'webmaster Directory'
(http://www.webhostshunter.com/)
'Recreation Vehicle insurance'
(http://www.insurance-owl.com/other/car_rec.php) | 'Free URL
redirection service' (http://urlkick.com/)
------------------------------------------------------------------------
FFMG's Profile: http://www.httppoint.com/member.php?userid=580
View this thread: http://www.httppoint.com/showthread.php?t=21522

Message Posted via the webmaster forum http://www.httppoint.com, (Ad revenue sharing).

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:36 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com