Author |
Topic |
sadbjp
INNER JOIN
41 Posts |
Posted - 2007-05-14 : 16:59:15
|
Hi,How can I do this using INNER JOIN:4. From tables RubricReport, RubricReportTemplate, RubricReportDetail and SppTarget, get columns:a. RubricReporti. ReportIDii. LastUpdateiii. LastUpdateByb. RubricReportTemplatei. IndicatorNumberii. Topiciii. Partiv. ILCDComponentc. RubricReportDetaili. LocalPerfii. GoalMetd. SppTargeti. Target5. Matching these columns in the above four tables:a. RubricReport.ReportID=RubricReportDetail.ReportIDb. RubricReportDetail.IndicatorID=RubricReportTemplate.IndicatorIDc. SppTarget.IndicatorNumber=RubricReportDetail.IndicatorNumberd. SppTarget.Years=@DataYearsI have looked a lot but couldn't find INNER join for three tables. |
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
sadbjp
INNER JOIN
41 Posts |
Posted - 2007-05-14 : 17:32:29
|
It is an interview question. |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-14 : 18:29:22
|
Please post the DDL, sample data and expected result KH |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-14 : 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
22864 Posts |
Posted - 2007-05-15 : 09:24:00
|
<<How can I do this using INNER JOIN:>>you cant because you hate INNER JOINYou need to understand basic SQL Here are some linkshttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp Also make use of SQL Server help fileMadhivananFailing to plan is Planning to fail |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-15 : 10:02:45
|
quote: Originally posted by madhivanan <<How can I do this using INNER JOIN:>>you cant because you hate INNER JOINYou need to understand basic SQL Here are some linkshttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp Also make use of SQL Server help fileMadhivananFailing to plan is Planning to fail
That won't do. These site will teach him use INNER JOIN for his query. KH |
|
|
sadbjp
INNER JOIN
41 Posts |
Posted - 2007-05-16 : 14:29:15
|
Its pretty easy to make fun of others and you guys are loving it. |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2007-05-16 : 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?- Jeffhttp://weblogs.sqlteam.com/JeffS |
|
|
sanjnep
Posting Yak Master
191 Posts |
Posted - 2007-05-16 : 15:12:45
|
Here you go it is so simple.declare @DataYears intset DataYears = 2007selecta.ReportID,a.LastUpdate,a.LastUpdateBy,b.IndicatorNumber,b.Topic,b.Part,b.ILCDComponent,c.RubricReportDetail,c.LocalPerf,c.GoalMet,d.Targetfrom RubricReport as a inner join RubricReportDetail as b on a.ReportID = b.ReportIDinner join RubricReportTemplate as c on b.IndicatorID = c.IndicatorIDinner join SppTarget as d on d.IndicatorID = c.IndicatorIDand d.Years=@DataYears |
|
|
sadbjp
INNER JOIN
41 Posts |
Posted - 2007-05-16 : 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
7423 Posts |
Posted - 2007-05-16 : 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?- Jeffhttp://weblogs.sqlteam.com/JeffS |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-05-17 : 00:25:45
|
<<but learner's should be motivated >>Didnt I motivate you by giving Learn SQL links? MadhivananFailing to plan is Planning to fail |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-08-19 : 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 solutionwithout 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 TTo walk FAST walk ALONE To walk FAR walk TOGETHER |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-08-19 : 03:59:20
|
Vaibhav, you do realize that you are responding to a 3 year old thread right ? KH[spoiler]Time is always against us[/spoiler] |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-08-19 : 04:16:13
|
quote: Originally posted by khtan Vaibhav, you do realize that you are responding to a 3 year old thread right ? KH[spoiler]Time is always against us[/spoiler]
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 TTo walk FAST walk ALONE To walk FAR walk TOGETHER |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-08-19 : 04:28:40
|
quote: it came in active topic
the spammer bump it KH[spoiler]Time is always against us[/spoiler] |
|
|
|