Hi,
I'm wondering if someone can show me a more elegant way to do a SQL
subquery.
I have a saved select list with a list of values which I want to
test
for in a SQL select IN clause.

Eg. 
SELECT @ID FROM EINVOICES WHERE
iInvoiceRef IN (SELECT EVAL
'TRANS('&SAVEDLISTS&","INV.REF.LIST","-1","")'
FROM VOC WHERE @ID =
'WHO');

This works, but I don't like the format of
the subquery. I have done
this type of thing before but when the list was a
list of keys to
another file I could create a subquery like SELECT @ID FROM
OTHER.FILE
SLIST INV.REF.LIST. In this case iInvoiceRef doesn't link to
another
file.

I have used the TRANS/VOC arrangement which seems like a
hack to me,
it's also relatively slow. Does anyone know a 'nicer' way to get
back a
select list to use with the IN clause?

Regards,
Stuart Boydell
**********************************************************************
This
email message and any files transmitted with it are confidential and intended
solely for the use of addressed recipient(s). If you have received this
communication in error, please reply to this e-mail to notify the sender of
its incorrect delivery and then delete it and your reply.  It is your
responsibility to check this email and any attachments for viruses and defects
before opening or sending them on. Spotless collects information about you to
provide and market our services. For information about use, disclosure and
access, see our privacy policy at http://www.spotless.com.au 
Please consider
our environment before printing this email.
**********************************************************************
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to