Need help with sql statement please

Aaron Bratcher aaronbratcher at abdatatools.com
Fri Nov 28 13:21:36 CST 2003


Unfortunately it only returns one record.  I have 21 records in 
personnel. 2 Records in hireHistory, and 1 record in statusHistory.  
The record being returned has a proper link into all 3 of these.  =(

--
Aaron Bratcher
ab DataTools
http://www.abDataTools.com

On Friday, November 28, 2003, at 12:21  PM, Ruslan Zasukhin wrote:

> on 11/28/03 6:28 PM, Aaron Bratcher at aaronbratcher at abdatatools.com 
> wrote:
>
>> I have the following tables (only relevant fields shown)
>>
>>
>> Personnel:
>> empid              Long
>> firstName          varChar
>> lastName           varChar
>> currentHireDate    ObjPtr->hireHistory
>> currentStatus       ObjPtr->statusHistory
>>
>>
>> hireHistory:
>> startDate          date
>> endDate            date
>>
>> statusHistory:
>> statusID           long
>>
>>
>> lists:
>> listID             long
>> listValue          varChar
>>
>>
>>
>> What I am trying to accomplish:
>>
>> I want to do an outer join to get all personnel records desired and
>> match appropriate hireHistory, statusHistory and lists records.
>> (statusID of statusHistory must match listID in lists)
>>
>> Is this possible? I know how to do the normal outer join between 2
>> tables, but not sure how to do it with the 4 tables involved.
>
> Hi Aaron,
>
> Not tested,
>
> Should looks as:
>
>  SELECT *
>  FROM Personel, hireHistory, statusHistory, lists
>  WHERE
>         Personel. currentHireDate *= hireHistory.RecID
>     and Personel. currentStatus *= statusHistory.RecID
>     and statusHistory.StatusId = lists.listID
>
>
> -- 
> 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
> -------------------------------------------------------------
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>
>



More information about the Valentina mailing list