-
Hi,
I'm having some problem with selecting data from 3 tables.Say I've 3 tables Employee,Bank_account and Expenses.Bank_account and expenses are referncing Employee table through Emp_Id field.I want to see the Account information and expense information of one employee (for example emp_id=1).But when I select data from thsese three tables using equal join for 2 tables,I'm getting duplicated values.
Employee Data:
Emp_Id Name
1 XXXX
2 YYYY
Bank_Accout table data:
Accout_No Emp_Id
100 1
200 1
300 2
Expenses information:
Id Emp_Id
20 1
30 2
Select Employee.emp_Id,accout_No,id from employee,bank_accout,expenses
where Employee.emp_id=Bank_account.emp_id and employee.emp_id=expenses.emp_id
and employee.emp_id=1;
This is showing the results like this:
Emp_id Accout_no id
1 100 20
1 200 20
But I want my result to look like this:
Emp_id Account_no id
1 100 20
1 200 -
I'm trying to make a report with this data.If some one knows about crystal reports please help me to get this result.
Thanks,
Kadari.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|