`single-row subquery returns more than one row` error unclarity

Jompoussy

New Member
I've got two tables. The first one hold a type and the second one the value of this type.In my example if there are more values 'john' as 'first_name' i get:\[code\]single-row subquery returns more than one row\[/code\]\[code\]SELECT DISTINCT id FROM name WHERE id=( SELECT id FROM name WHERE text1='first_name' INTERSECT SELECT name_id FROM value WHERE text2='john');\[/code\]I'm not very good with sql. I should use \[code\]LEFT JOIN\[/code\] or something like that but it's not really clear to me how i should do this.
 
Top