Is there a way to select records based on comparing field values in two related tables?

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Nov 23 23:00:16 CST 2006


On 11/23/06 1:41 PM, "Steven Ronald" <stevenrt39 at yahoo.com.au> wrote:

Hi Steven,

>> First of all.
> 
>> * WHY you have foo1 in the table B ?
> 
>>    this is DUPLICATION of data. Right?
>>    this is not good.
>>    You do not need that!
> 
> Mea Culpa. I don't come from a relational db
> background but began working on web applications using
> Verona in WS, and got into the habit of making my own
> permanent record ids, since in verona you can't assume
> the intrinsic record id stays constant. By the time I
> moved to valentina I wasn't thinking in terms of
> relating tables since I had got used to thinking in
> terms of a flat database.
> 
> Now I'm updating some code I want to take advantage of
> relating tables where appropriate. One thing I need to
> do is get rid of my own record ids (foo1) and instead
> use Object_ptr fields - you're right.

Aha, so it have play role of ID,
I did not realize that.
 
Note, Valentina support this way also. This is pure relational model way. In
the WIKI exists article that compare this ways.

If somebody use own IDs then query looks almost the same, and in table A you
do not have objectpPTr.

SELECT A.foo2
FROM A join B on A.foo1 = B.foo1
WHERE timestamp < tpayment

Actually this can be done in more short form for Valentina

SELECT A.foo2
FROM A join B
WHERE timestamp < tpayment


> ****
> It is never stated in the documentation, but I presume
> the correct (and only) way to populate the Object_ptr
> field of a record in a Table is to first retrieve the
> RecID field of the related record in the other
> (related) table?

right

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list