| re: String vs Numeric Type (2)
Brian Tkatch wrote:
[color=blue]
> One PROCEDURE that has one query, that SELECTs from one TABLE and gets
> names off of FKs to 13 lookup TABLEs, so i put it in a join (as opposed
> to 13 sub-SELECTs). Originally, i used all the TABLE names, but given
> the size of their names, i couldn't see the entire thing on one screen
> (in notepad) so i changed the main TABLE to be aliased as Main, and the
> lookups as A, B, C, etc.. So my query (basically) looks like
>
> SELECT Main.col1, Main.Col2, Main.A, A.text, Main.B, B.Text etc...
> FROM ...
> WHERE A.Id = Main.A AND B.Id = Main.B AND etc...[/color]
Gosh, that looks ugly and clutters the statement making its meaning less
obvious. I would have used the sub-selects to make the structure of the
query clear, i.e. only data from the main table is requested and
restrictions are imposed based on the other 13 tables. The rest is up to
the optimizer to straighten out.
--
Knut Stolze
DB2 Information Integration Development
IBM Germany |