Subject Re: Part of string into JOIN statement
Author majstoru
--- In firebird-support@yahoogroups.com, "Ann W. Harrison"
<aharrison@...> wrote:

> You (or the designer of the database) have violated one of the
> cardinal rules of relational database design. Values are atomic -
> in the pre-1903 sense of the word - they are particles of data
> that can not be subdivided. Now, maybe you're actually Nils Bohr
> and will show the world how to use subatomic data effectively.
> Or maybe not.

Thanks Ann for help! I'm designer of a database, and sample data that
is is in my primer are little "stupid" to represent my real database
structure!
My real data is a part of finanse table which is contain all data
about financial transactions where first 4 letter represent a
finansial plan nuber, and another n number represent a partner.
All I need is to execute some SQL statement which will connect
financial data with partner detail for report only, not for any
another use (something like financial specefication of all partners).

>
> If you can change the design, split that field into two atomic
> fields. If you want, you can create a computed field of the
> two values concatenated and use the old field name for the computed
> field while using the atomic parts for this join and other
operations

This split "tip" will help in some another problems like this!

> on the individual parts. Or, I guess, you could either create two
> computed fields that represent the two halves of the combined field
-
> or make real fields and maintain them with triggers.
>
> Substring is probably the operation you want.

SUBSTRING is a BINGO, all works great!

Thanks again Ann!