At 9:24 -0600 2/5/03, Jaime Teng wrote:
I have a MySQL table:

+------------+------------------+------+-----+---------+----------------+
| Field      | Type             | Null | Key | Default | Extra          |
+------------+------------------+------+-----+---------+----------------+
| id         | int(10) unsigned |      | PRI | NULL    | auto_increment |
| account    | varchar(10)      |      | MUL |         |                |
| detail     | text             | YES  |     | NULL    |                |
+------------+------------------+------+-----+---------+----------------+


I would like to perform a search,

SELECT id,account FROM tablename WHERE detail LIKE '%pattern%';

However, this would produce several hits for a single account.
I'd like it to produce only one hit *per* account and give me
id where '%pattern%' was found and account where it was found on.
It should only return *one* result per account.
Hmm...

Either I am not understanding what you are saying, or what you are
saying makes no sense: If there are two id values for a given account
that have detail values matching the pattern, which id do you want
it to display?

regards,
Jaime
sql, query

---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to