[thelist] SQL Question
Steve Abaffy
sabaffy at mswebdevelopment.com
Wed Oct 29 16:41:26 CST 2003
If I understand your question
UserTable:
NumUser
FirstName
Lastname
otherUserFields
CreatedTable
CreatedTableID
NumUser
Createdby
Modifiedby
So your join would look like
Select
a.NumUser,
a.FirstName,
a.LastName,
b.Createdby,
b.Modifiedby
from UserTable a
Left Join CreatedByTable b
on a.Numuser = b.NumUser
> -----Original Message-----
> From: thelist-bounces at lists.evolt.org
> [mailto:thelist-bounces at lists.evolt.org]On Behalf Of David Mitchell
> Sent: Wednesday, October 29, 2003 2:18 PM
> To: thelist at lists.evolt.org
> Subject: [thelist] SQL Question
>
>
> Hi All,
>
> Not sure the best way to go about this. Here is the scenario:
>
> I have a "user" table with a field "NumUser" as the key.
> I have another table with the fields "CreatedBy" and "ModifiedBy". Each
> one of these fields will have a "NumUser" value in it (except that
> ModifiedBy may be null). I am attempting to do a join across these 2
> tables to get the FirstName and LastName values for the CreatedBy and
> ModifiedBy values. Make sense?
>
> Any advice is appreciated.
>
> Dave
>
> /**
> David Mitchell
> www.dbmdata.com
> dave at dbmdata.com
> */
>
> MortgagePro.ca - Now accepting online mortgage applications!
> http://www.mortgagepro.ca
>
> --
> * * Please support the community that supports you. * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>
>
More information about the thelist
mailing list