HELP: Query Advice

Ruslan Zasukhin sunshine at public.kherson.ua
Sun May 2 20:26:27 CDT 2004


On 5/2/04 8:17 PM, "Ian Devaney" <idevaney at mac.com> wrote:

Hi Ian,

> A bit brain-dead today - I think this should be really simple!
> 
> I have 3 tables. Contacts, Contact_Groups and Lists.
> 
> These are linked via object pointers.
> 
> The main Contact record holds only 1 pointer to the Contact_Groups
> table but several to the Lists table. The Lists table contains stuff
> like Prefix, Suffix, Country.
> 
> 2 questions:
> 
> 1, How do I structure the SQL to get all the data?

I think you need to use table aliases

    select 
    from Contacts, Contact_Groups, Lists a, lists b, lists c
    WHERE ...


> 2, Once I have a cursor with all the data what is the best way to deal
> with it?


> In Valentina I can't say:
> 
> "lists.list_value as Prefix, lists.list_value as Suffix,
> lists.list_value as Country"

> So what do most people do in this situation?

You can use index to get field.
    
    field(1)

Also I wonder:
    do you have strong reasons to keep in the same column 'Value'
    data of different types? May be better to use 3 tables ?

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list