Re: SQL question

From: Harry Joe <hvattyam_at_yahoo.com>
Date: Mon, 11 Sep 2000 10:15:26 -0400
Message-ID: <39BCE8FE.67C0AADC_at_yahoo.com>


Greg wrote:

> I try to use this query
>
> delete from T_DIST_LIST_TMP LIST1
> where LIST1.NAME_ID
> and LIST1.CONTACT_ID in
> (select LIST2.NAME_ID,
> LIST2.CONTACT_ID
> from T_DIST_LIST_TMP LIST2
> where DIST_ID = P_DIST_ID
> and VER1.NAME_ID = VER2.NAME_ID
> and VER1.NAME_CONTACT not like '%_at_%');
>
> I get the error
> 270/5 PL/SQL: SQL Statement ignored
> 271/17 PLS-00382: expression is of wrong type
>
> Is it not possible to use more the one
> parameter with the IN Operator.
>
> delete from T_DIST_LIST_TMP LIST1
> where LIST1.NAME_ID in
> (select LIST2.NAME_ID,
> from T_DIST_LIST_TMP LIST2
> where DIST_ID = P_DIST_ID
> and VER1.NAME_ID = VER2.NAME_ID
> and VER1.NAME_CONTACT not like '%_at_%');
> and LIST1.CONTACT_ID in
> (select LIST2.CONTACT_ID
> from T_DIST_LIST_TMP LIST2
> where DIST_ID = P_DIST_ID
> and VER1.NAME_ID = VER2.NAME_ID
> and VER1.NAME_CONTACT not like '%_at_%');
>
> That delete works..
>
> Thanks Greg

Try
 ... where (LIST1.NAME_ID, LIST1.CONTACT_ID)   in (select ..)

This should work.

Harry Received on Mon Sep 11 2000 - 16:15:26 CEST

Original text of this message