> select * from attributes_table where id in (select id from> attributes where (name='obsid') and (value='oid00066'));
Can you convert it into a join? 'where in' clauses tend to slow pgsqldown. --Mike Nolan