自己のJOIN
が必要です 。
SELECT t1.*
FROM my_table t1
INNER JOIN my_table t2 ON t1.pid = t2.pid
WHERE t1.key = 'city' and t1.value = 'new york'
AND t2.key = 'country' and t2.value = 'united states';
自己のJOIN
が必要です 。
SELECT t1.*
FROM my_table t1
INNER JOIN my_table t2 ON t1.pid = t2.pid
WHERE t1.key = 'city' and t1.value = 'new york'
AND t2.key = 'country' and t2.value = 'united states';