Hi,
I was having a similar related problem recently. I need to include an IN statement in the where clause and couldn’t find where to put it. In the where clause builder it doesn’t mention anything about sub selects…but you can just type them in and they work fine.
So you can set up your object to correspond to the column, and in the where clause include the sub query you want. Its a shame this isn’t documented. It got me stumped for a while.
btw. You’re probably already aware, but its possible to transform a sub-query of this form into a straight join.
Your SQL becomes :
select a.columnA from TableA a, TableB b where a.ColumnA = b.ColumnB
which acheives the same result. But I think in this case you can simply add in the clause you need in the Where box.
Let me know if you need any other help
L.
______________________________ Reply Separator _________________________________
Author: “Cirkel; Jonathan D” jc14547@GLAXOWELLCOME.CO.UK at DTCG.UK.INTERNET
Date: 30/07/98 13:16
Today’s dose of brain failure…
I am struggling with creating a simple sub-query in BusObj that is easy in SQL.
First, the very simple (part) table structure
TableA.ColumnA-------TableB.ColumnA
TableB.ColumnB-------TableC.ColumnB
In SQL what I want is:
Select ColumnA from TableA where ColumnA not in (select ColumnA from TableB)
ie basically selecting all the values in table A which don’t have a value B associated with them.
Now, in SQL this is simple because you’re selecting a single column from the ‘joining’ table (B). In BusObj you can’t do this because you don’t physically see anything from table B, you only see the valid values in tables A and C meaning that you have to include 2 objects in your sub-query, which of course you can’t do with an ‘In List’ operator.
What am I missing?
Regards
Jonathan
Project Leader
Global Medical, Regulatory and Product Strategy (GMRPS) IS
Listserv Archives (BOB member since 2002-06-25)