table aliases

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Mar 16 20:40:45 CST 2004


On 3/16/04 7:32 PM, "fiona cosgrove" <fionacosgrove at yahoo.co.uk> wrote:

Hi Fiona,

> how does valentina use aliases? The previous example I
> dont necessarily need them but im sure my other sql
> string requires it:
> 
> select wstr_id, wstr_number, wstr_title,
> (ai.wwri_count)/ length(wstf_fulltext)*1000 as
> wstr_score from wstr, wwri as ai, wwrd as a, wstf
> where (wstr_id = ai.wwri_wstr_id) and (ai.wwri_wwrd_id
> = a.wwrd_id) and wstf_wstr_id = wstr_id and
> (a.wwrd_word = 'biology'  ) order by wstr_score desc"
> 
> do you now how would I write this for valentina?

Valentina 1.x support Table aliases.
But not field aliases.

Valentina 2.0 will field aliases also.


Your above example must be made in this way

1) you need make virtual field "wstr_score" (BaseObject method)
    with formula
            wwri_count / length( wstf_fulltext ) * 1000

NOTE: fields must be from the same table



2) now you can do query

    select wstr_id, wstr_number, wstr_title, wstr_score
    FROM ..
    WHERE ...   
    ORDER BY wstr_score



-- 
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