June 14, 2012 at 12:55 pm
hello friends
i am struck in one problem.
in my problem , i need to display Mobility Indicator.
in that if student transfer School in schoolyear 2010/2011 then mobility indicator display 1 in 2011/12
if student transfer School in schoolyear 2009/2010 then mobility indicator display 1 in 2010/11
this is StudentSchoolHistory table looks like
StudentIDiSchoolYearCodeiSchoolCode
0033514592009312
0033514592009322
0033514592010322
0033514592011317
so please help me
Thanks
June 14, 2012 at 1:26 pm
First of all this looks a lot like homework. As such we will point you in the direction of a solution but not actually provide it.
Second there is nowhere near enough information here to help. We would need to see ddl, sample data and desired output. See the first link in my signature.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
June 14, 2012 at 9:10 pm
It appears that there is more than one person stumped on the same homework problem:
http://www.sqlservercentral.com/Forums/Topic1316272-391-1.aspx?Update=1
My thought question: Have you ever been told that your query runs too fast?
My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.
Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
Since random numbers are too important to be left to chance, let's generate some![/url]
Learn to understand recursive CTEs by example.[/url]
[url url=http://www.sqlservercentral.com/articles/St
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply