On Nov 14, 2005, at 2:07 PM, Steve Wampler wrote:
> # SELECT at.id FROM "tmp_table2" at, "tmp_tabl2e" a
> # WHERE at.id=a.id and a.name='obsid' and a.value='oid080505';
Isn't this equivalent?
select id from tmp_table2 where name = 'obsid' and value = 'oid080505';
> # DELETE FROM "tmp_table2" WHERE id IN
> # (SELECT at.id FROM "tmp_table2" at, "tmp_table2" a
> # WHERE at.id=a.id and a.name='obsid' and a.value='oid080505');
and this?
delete from tmp_table2 where name = 'obsid' and value = 'oid080505';
Why are you doing a self-join using id, which I assume is a primary key?
--
Scott Lamb <http://www.slamb.org/>