|
|
Archives of the TeradataForum
Message Posted: Wed, 02 Sep 2009 @ 17:10:25 GMT
Subj: | | Re: Subqueries Workaround |
|
From: | | frank.c.martinez |
Rather broad statement, that. You can do all kinds of subqueries. You can't do scalar subqueries (yet, anyway). Well, actually, mi amigo
Keith Jones pointed out that you can do a UDF, which could be a sort of a scalar "subquery". But then again, looking at the code, you hard-code
the patient id twice. Wouldn't you rather do a correlated subquery, and just do it once? Or maybe just forget the "sub" part of things and join
twice (probably an outer join, in case they didn't take either drug) to the drug_taken table. Probably be a little clearer.
iv
| |