Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
arusu
Yak Posting Veteran
60 Posts |
Posted - 2010-08-24 : 15:02:39
|
| hi, i have a select statement that selects an employee and there is an employee id that links to a job table. so i need select e.name, e.addressinner join job j on e.equipment_id = j.equipment_idbut an employee can have multiple jobs but i don't want it to return more rows because of multiple jobs.hope i explained it ok but.... |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
arusu
Yak Posting Veteran
60 Posts |
Posted - 2010-08-24 : 15:12:48
|
| ok to give a little more detail this employee table is linked with a company table so a company can have the same employee as another company and each employee has a performance table so when you look at everything in a view, it could be like thiscompany employee performanceA jack goodB jack poorand basically i want to use the job as a user filter. So a user can select a job and display everyone based on a job and some other filters which are not important. But when i inner join the job table, i get more performance results and i shouldn'tnot sure if that makes more sense but that's what i need |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2010-08-24 : 16:09:51
|
quote: Originally posted by arusu <snip>not sure if that makes more sense but that's what i need
Not really. We'd love to help you, but what you ahve posted doesn't really make much sense. Additionally, we have no idea what tables you have or how they relate to each other. This link might help you with posting your question so we can help you better:http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-08-25 : 09:27:32
|
quote: Originally posted by arusu ok to give a little more detail this employee table is linked with a company table so a company can have the same employee as another company and each employee has a performance table so when you look at everything in a view, it could be like thiscompany employee performanceA jack goodB jack poorand basically i want to use the job as a user filter. So a user can select a job and display everyone based on a job and some other filters which are not important. But when i inner join the job table, i get more performance results and i shouldn'tnot sure if that makes more sense but that's what i need
then you need to have a field (may be an id) which determines which employee belongs to which company (may be names are same but id will be different)------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|