| Author |
Topic  |
|
|
sadbjp
INNER JOIN
41 Posts |
Posted - 05/14/2007 : 16:59:15
|
Hi,
How can I do this using INNER JOIN:
4. From tables RubricReport, RubricReportTemplate, RubricReportDetail and SppTarget, get columns: a. RubricReport i. ReportID ii. LastUpdate iii. LastUpdateBy b. RubricReportTemplate i. IndicatorNumber ii. Topic iii. Part iv. ILCDComponent c. RubricReportDetail i. LocalPerf ii. GoalMet d. SppTarget i. Target 5. Matching these columns in the above four tables: a. RubricReport.ReportID=RubricReportDetail.ReportID b. RubricReportDetail.IndicatorID=RubricReportTemplate.IndicatorID c. SppTarget.IndicatorNumber=RubricReportDetail.IndicatorNumber d. SppTarget.Years=@DataYears
I have looked a lot but couldn't find INNER join for three tables. |
|
|
jsmith8858
Dr. Cross Join
USA
7423 Posts |
|
|
sadbjp
INNER JOIN
41 Posts |
Posted - 05/14/2007 : 17:32:29
|
| It is an interview question. |
 |
|
|
jsmith8858
Dr. Cross Join
USA
7423 Posts |
|
|
khtan
In (Som, Ni, Yak)
Singapore
16746 Posts |
Posted - 05/14/2007 : 18:29:22
|
Please post the DDL, sample data and expected result 
KH
|
 |
|
|
khtan
In (Som, Ni, Yak)
Singapore
16746 Posts |
Posted - 05/14/2007 : 21:43:29
|
Wait a minute .. .
quote: INNER JOINS ON FOUR TABLES
Are you sure you want INNER JOIN ?
quote: I hate using INNER joins

KH
|
 |
|
|
madhivanan
Premature Yak Congratulator
India
22460 Posts |
|
|
khtan
In (Som, Ni, Yak)
Singapore
16746 Posts |
|
|
sadbjp
INNER JOIN
41 Posts |
Posted - 05/16/2007 : 14:29:15
|
| Its pretty easy to make fun of others and you guys are loving it. |
Edited by - sadbjp on 05/16/2007 14:30:48 |
 |
|
|
jsmith8858
Dr. Cross Join
USA
7423 Posts |
Posted - 05/16/2007 : 14:52:28
|
It is very easy to make fun of others. It is also easy to ask people to do your work for you with no effort on your part to learn. Did you follow my advice at all from the previous thread?
- Jeff http://weblogs.sqlteam.com/JeffS
|
 |
|
|
sanjnep
Posting Yak Master
USA
190 Posts |
Posted - 05/16/2007 : 15:12:45
|
Here you go it is so simple.
declare @DataYears int set DataYears = 2007
select a.ReportID, a.LastUpdate, a.LastUpdateBy, b.IndicatorNumber, b.Topic, b.Part, b.ILCDComponent, c.RubricReportDetail, c.LocalPerf, c.GoalMet, d.Target from RubricReport as a inner join RubricReportDetail as b on a.ReportID = b.ReportID inner join RubricReportTemplate as c on b.IndicatorID = c.IndicatorID inner join SppTarget as d on d.IndicatorID = c.IndicatorID and d.Years=@DataYears |
 |
|
|
sadbjp
INNER JOIN
41 Posts |
Posted - 05/16/2007 : 16:31:58
|
| Forget it. There is no point in arguing. BTW, I am done with what I had asked and I always try to come with answers on my own and then post questions on this forum. All I want to say is that, this is a great place but learner's should be motivated and respected. |
 |
|
|
jsmith8858
Dr. Cross Join
USA
7423 Posts |
Posted - 05/16/2007 : 16:42:57
|
sadbjp -- to get respect, you have to give respect back. Always remember that. You have to earn it by showing the willingness to learn. Just cutting and pasting interview questions and ignoring everyone that doesn't immediately give you the answer is not the way to learn or earn respect. I gave you great advice in the previous thread, and tried very hard to "motivate" you and told you how I and many others learned the basics of SQL, and then I asked you again about it here, and each time you ignored my efforts completely. Why should anyone help you or give you respect if you don't make any effort whatsoever on your part?
- Jeff http://weblogs.sqlteam.com/JeffS
|
 |
|
|
madhivanan
Premature Yak Congratulator
India
22460 Posts |
Posted - 05/17/2007 : 00:25:45
|
<< but learner's should be motivated >>
Didnt I motivate you by giving Learn SQL links? 
Madhivanan
Failing to plan is Planning to fail |
 |
|
|
vaibhavktiwari83
Aged Yak Warrior
India
837 Posts |
Posted - 08/19/2010 : 03:40:43
|
quote: Originally posted by sadbjp
Its pretty easy to make fun of others and you guys are loving it.
@sadbjp -
In this site i feel that here is a lot of great SQL programmers are available for you to solve your problem at the depth of solution without getting irritated or ignoring your question.
Initially when i started this forum i also asked many questions here which might be homework questions but i got a lot of very good response to make me reach to the solution without giving me the solution.
so that i was able to reach to those type of solutions on my own next time. if someone will work for you. you will always be disabled. I dont think you want to be, do you?
now i am able to learn from answers given to other's questions by experts without questioning. 
Vaibhav T
To walk FAST walk ALONE To walk FAR walk TOGETHER |
 |
|
|
khtan
In (Som, Ni, Yak)
Singapore
16746 Posts |
Posted - 08/19/2010 : 03:59:20
|
Vaibhav, you do realize that you are responding to a 3 year old thread right ? 
KH Time is always against us
|
 |
|
|
vaibhavktiwari83
Aged Yak Warrior
India
837 Posts |
Posted - 08/19/2010 : 04:16:13
|
quote: Originally posted by khtan
Vaibhav, you do realize that you are responding to a 3 year old thread right ? 
KH Time is always against us
No, because i did nt see date of second last reply. as it came in active topic. any ways i expressed my thoughts... cheers...!!!
Vaibhav T
To walk FAST walk ALONE To walk FAR walk TOGETHER |
 |
|
|
khtan
In (Som, Ni, Yak)
Singapore
16746 Posts |
Posted - 08/19/2010 : 04:28:40
|
quote: it came in active topic
the spammer bump it
KH Time is always against us
|
 |
|
| |
Topic  |
|