Hello,
I'm new to mysql (and databases, fo that matter) and have problems
finding a solution. The situation is as follows:
I have one table with filtered information about users, the columns
are, say, id, field and value. As you can see, any id can have more
rows assiciated with him, each containing one crucial piece of
information. Now I want to search the values for something and return
all rows with the same id -- in effect this means that I cannot use
"select * from t where value like ... ", which does, of course, return
all rows that match the expression rather than all rows with the same
id that happened to also contain a value with the expression.

If I'm not clear enough, here's an example:

id field value
--|-----|-------
a  x     string1
a  y     string2
b  x     string3
a  z     string4

"select * from t where value like string2" returns the second row, but
I want to return all rows with the same id as in row number two.

I've tried this subquery, to no avail: select * from t where id =
(select id from t where value like '%string2%' limit 1)

Thanks,

andrej


-- 
echo ${girl_name} > /etc/dumpdates            http://sonet.homelinux.net

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to