i have a table like this
+-----------+---------------------+------+-----+---------+----------------+
| Field     | Type                | Null | Key | Default | Extra          |
+-----------+---------------------+------+-----+---------+----------------+
| id        | int(100) unsigned   |      | PRI | NULL    | auto_increment |
| dir_name  | varchar(255)        | YES  |     | NULL    |                |
| file_name | varchar(255)        | YES  |     | NULL    |                |
---------------------------------------------------------------------------

and i want to do the following select :
select   distinct  dir_name, file_name from tablename where dir_name
like "%th_same_foo%" or file_name like "%the_same_foo%" ;

but i also wont to have the id's of fields i've selected, and it makes
no sense to put select distinct id, dir_name, ....... cause a primary
key is always distinct

does anyone know how to do all this in one select statement?

thanks in advanse


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to