--- Dorward Villaruz <dorwardv@ntsp.nec.co.jp> wrote:
>
> here is my sql statement
>
> psql -h $HOSTNAME -d $DBNAME -c "DELETE FROM custinfo WHERE
> custinfo.UserID IN (SELECT custinfotemp.userid FROM custinfotemp
> where updateStatus='D')";
Try this
DELETE FROM custinfo
WHERE
custinfo.UserID = custinfotemp.userid AND
custinfotemp.updateStatus = 'D';
It would be good to have indexs on UserID on both tables.
Seeing a table named "custinfotemp" kind of raises a red
flag. Possibly you may want to re-think the design if
you are moving data between tables that is really the
same data.
=====
Chris Albertson
Home: 310-376-1029 chrisalbertson90278@yahoo.com
Cell: 310-990-7550
Office: 310-336-5189 Christopher.J.Albertson@aero.org
__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com