Link to home
Start Free TrialLog in
Avatar of triphen
triphen

asked on

SyBase SQL Syntax

Hey guys,
 
I have 2 tables using SyBase SQL Anywhere 10
Employee Table
EmpNum
Firstname
Lastname
 
Sales Table
Transact
WhoStart (EmpNum)
WhoClosed   (EmpNum)
 
I want to return the transaction number and the first name’s of the employee who started and closed the sale. Usually the person who starts and closes is the same, but sometimes it’s not.
 
Help?
SOLUTION
Avatar of wilcoxon
wilcoxon
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Tangent...  Personally I *HATE* the ANSI join syntax.  I find it much harder to read than the "old" join syntax.  For this query, it's not bad but, as it gets more complex, the less I like ANSI joins.
Avatar of triphen
triphen

ASKER

Thanks guys! I ended up using the ANSI join syntax.

left outer join dba.employee as es
on es.empnum = header.whostart

left outer join dba.employee as ec
on ec.empnum = header.whoclose