<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7722919413435717673</id><updated>2024-08-28T15:45:07.886+05:30</updated><category term="MS-SQL Server"/><title type='text'>Subhash Pande</title><subtitle type='html'>Everything about Information Technology and Current affair</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://subhashpande.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7722919413435717673/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://subhashpande.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Subhash Pande</name><uri>http://www.blogger.com/profile/08276592944041831114</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2bihic-LNubT2Z8EIMuU6tSlE5y3RxnPjCN9N5MTKYUiQfcOR8ZDHHizX-lWbnV17sTxXpJvvIqywuhyQyEfe3YYjfnD5pGcYKLgtY3j_Er3YmumBskwnrO5CG-jK0g4/s220/Subhash.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7722919413435717673.post-79822666329569198</id><published>2010-09-28T13:15:00.000+05:30</published><updated>2010-09-28T13:15:46.135+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="MS-SQL Server"/><title type='text'>Custom Order By in MS SQL Server</title><content type='html'>Custom Order By&lt;br /&gt;
&lt;br /&gt;
In MS SQL we cannot achieve sorting by using Order By on Varchar data type. We can do sorting on Int data type. To resolve this problem I suggest following solution. E.g. There is table in which AcadLevel is column having datatype varchar.Stored values are ‘Diploma’,&#39;Graduate’,&#39;PostGraduate’,&#39;M.Phill’,&#39;Ph.D.’.I want to display Higher AcademicLevel first followed by remaining.&lt;br /&gt;
&lt;br /&gt;
E.g.&lt;br /&gt;
&lt;br /&gt;
Ph.D.&lt;br /&gt;
&lt;br /&gt;
M.Phill&lt;br /&gt;
&lt;br /&gt;
PostGraduate&lt;br /&gt;
&lt;br /&gt;
Graduate&lt;br /&gt;
&lt;br /&gt;
Diploma.&lt;br /&gt;
&lt;br /&gt;
For that I have used custom Order By.&lt;br /&gt;
&lt;br /&gt;
SELECT  Tr_ID ,&lt;br /&gt;
FacultyCourse ,&lt;br /&gt;
AcadLevel ,&lt;br /&gt;
dbo.M_Tech_Academics.FacultyCourse_ID ,&lt;br /&gt;
Subject_Name ,&lt;br /&gt;
CourseType ,&lt;br /&gt;
CollegeName ,&lt;br /&gt;
PassingYear ,&lt;br /&gt;
Faculty_ID&lt;br /&gt;
FROM    dbo.M_Tech_Academics&lt;br /&gt;
INNER JOIN dbo.M_FacultyCourse ON dbo.M_Tech_Academics.FacultyCourse_ID = dbo.M_FacultyCourse.FacultyCourse_ID&lt;br /&gt;
WHERE   Tr_ID = @Tr_ID&lt;br /&gt;
&lt;b&gt;ORDER BY&lt;br /&gt;
CASE AcadLevel&lt;br /&gt;
WHEN ‘Ph.D.’ THEN 1&lt;br /&gt;
WHEN ‘M.Phill’ THEN 2&lt;br /&gt;
WHEN ‘PostGraduate’ THEN 3&lt;br /&gt;
WHEN ‘Graduate’ THEN 4&lt;br /&gt;
WHEN ‘Diploma’ THEN 5&lt;br /&gt;
END&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://subhashpande.blogspot.com/feeds/79822666329569198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://subhashpande.blogspot.com/2010/09/custom-order-by-in-ms-sql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7722919413435717673/posts/default/79822666329569198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7722919413435717673/posts/default/79822666329569198'/><link rel='alternate' type='text/html' href='http://subhashpande.blogspot.com/2010/09/custom-order-by-in-ms-sql-server.html' title='Custom Order By in MS SQL Server'/><author><name>Subhash Pande</name><uri>http://www.blogger.com/profile/08276592944041831114</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2bihic-LNubT2Z8EIMuU6tSlE5y3RxnPjCN9N5MTKYUiQfcOR8ZDHHizX-lWbnV17sTxXpJvvIqywuhyQyEfe3YYjfnD5pGcYKLgtY3j_Er3YmumBskwnrO5CG-jK0g4/s220/Subhash.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7722919413435717673.post-3562976594281784238</id><published>2010-02-23T20:21:00.000+05:30</published><updated>2010-02-23T20:21:22.041+05:30</updated><title type='text'>Three-tier architecture in .net</title><content type='html'>&lt;a href=&quot;http://www.thesmartcodes.com/three-tier-architecture-in-net/&quot;&gt;Three-tier architecture in .net&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://subhashpande.blogspot.com/feeds/3562976594281784238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://subhashpande.blogspot.com/2010/02/three-tier-architecture-in-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7722919413435717673/posts/default/3562976594281784238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7722919413435717673/posts/default/3562976594281784238'/><link rel='alternate' type='text/html' href='http://subhashpande.blogspot.com/2010/02/three-tier-architecture-in-net.html' title='Three-tier architecture in .net'/><author><name>Subhash Pande</name><uri>http://www.blogger.com/profile/08276592944041831114</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2bihic-LNubT2Z8EIMuU6tSlE5y3RxnPjCN9N5MTKYUiQfcOR8ZDHHizX-lWbnV17sTxXpJvvIqywuhyQyEfe3YYjfnD5pGcYKLgtY3j_Er3YmumBskwnrO5CG-jK0g4/s220/Subhash.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7722919413435717673.post-6299819978526839650</id><published>2010-02-22T17:29:00.000+05:30</published><updated>2010-02-22T17:29:50.004+05:30</updated><title type='text'>How browsers understand ASP.NET web pages?</title><content type='html'>&lt;a href=&quot;http://www.thesmartcodes.com/how-browsers-understand-asp-net-web-pages/&quot;&gt;How browsers understand ASP.NET web pages?&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://subhashpande.blogspot.com/feeds/6299819978526839650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://subhashpande.blogspot.com/2010/02/how-browsers-understand-aspnet-web.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7722919413435717673/posts/default/6299819978526839650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7722919413435717673/posts/default/6299819978526839650'/><link rel='alternate' type='text/html' href='http://subhashpande.blogspot.com/2010/02/how-browsers-understand-aspnet-web.html' title='How browsers understand ASP.NET web pages?'/><author><name>Subhash Pande</name><uri>http://www.blogger.com/profile/08276592944041831114</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2bihic-LNubT2Z8EIMuU6tSlE5y3RxnPjCN9N5MTKYUiQfcOR8ZDHHizX-lWbnV17sTxXpJvvIqywuhyQyEfe3YYjfnD5pGcYKLgtY3j_Er3YmumBskwnrO5CG-jK0g4/s220/Subhash.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7722919413435717673.post-5689785623203202734</id><published>2009-11-10T23:01:00.000+05:30</published><updated>2009-11-10T23:09:21.716+05:30</updated><title type='text'>My Pune City</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5t06aPNH_1EkenIwzrpbsJ3kS4Sg3r25axhDysEkjFnxebws3TEeXPOrMf-LpBW2O5NCFq_IWndx1toOS3Hta74pCCwQXyoG3w-cDC-TBQvUX2n_jS7IvnbjWxoWVxOaHW2fgcMwfPkE/s1600-h/Shaniwarwada.jpg&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5t06aPNH_1EkenIwzrpbsJ3kS4Sg3r25axhDysEkjFnxebws3TEeXPOrMf-LpBW2O5NCFq_IWndx1toOS3Hta74pCCwQXyoG3w-cDC-TBQvUX2n_jS7IvnbjWxoWVxOaHW2fgcMwfPkE/s320/Shaniwarwada.jpg&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5402530901028649122&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Pune:- &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Pune (pronounced [puɳeː], Marathi: पुणे), formerly known as Punawadi or Punya-Nagari or Poona, is the eighth largest city in India, and the second largest in the state of Maharashtra, after Mumbai. Situated 560 metres above sea level on the Deccan plateau at the confluence of the Mula (Marathi: मुळा) and Mutha rivers (Marathi: मुठा) [3], Pune is the administrative capital of Pune district and the 7th Metro city of India.&lt;br /&gt;&lt;br /&gt;Pune is known to have existed as a town since 937 AD.[4] Shivaji, the founder of the Maratha Empire, lived in Pune as a boy, and later oversaw significant growth and development of the town during his reign. In 1730, Pune became an important political centre as the seat of the Peshwa, the prime minister of the Chhatrapati of Satara. After the town was annexed to British India in 1817, it served as a cantonment town and as the &quot;monsoon capital&quot; of the Bombay Presidency until the independence of India.&lt;br /&gt;&lt;br /&gt;Today, Pune is known for its educational facilities, having more than a hundred educational institutes and nine universities[5]. Pune has well-established Manufacturing, Glass, Sugar and Metal Forging industries since 1950-60s. Pune also has a growing industrial hinterland, with many information technology and automotive companies setting up factories in Pune district. Additionally, Pune city is well known for various cultural activities like Classical Music, Sports, Literature, Foreign language learning and Administrative, Economics, Social Science studies. These activities and job opportunities attract migrants and students from all over India, and also attract students from Middle-East, Iran, Eastern Europe, South-East Asia which makes for a city of many communities and cultures.&lt;br /&gt;&lt;br /&gt;Reference :- www.wikipedia.com</content><link rel='replies' type='application/atom+xml' href='http://subhashpande.blogspot.com/feeds/5689785623203202734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://subhashpande.blogspot.com/2009/11/my-pune-city.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7722919413435717673/posts/default/5689785623203202734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7722919413435717673/posts/default/5689785623203202734'/><link rel='alternate' type='text/html' href='http://subhashpande.blogspot.com/2009/11/my-pune-city.html' title='My Pune City'/><author><name>Subhash Pande</name><uri>http://www.blogger.com/profile/08276592944041831114</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2bihic-LNubT2Z8EIMuU6tSlE5y3RxnPjCN9N5MTKYUiQfcOR8ZDHHizX-lWbnV17sTxXpJvvIqywuhyQyEfe3YYjfnD5pGcYKLgtY3j_Er3YmumBskwnrO5CG-jK0g4/s220/Subhash.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5t06aPNH_1EkenIwzrpbsJ3kS4Sg3r25axhDysEkjFnxebws3TEeXPOrMf-LpBW2O5NCFq_IWndx1toOS3Hta74pCCwQXyoG3w-cDC-TBQvUX2n_jS7IvnbjWxoWVxOaHW2fgcMwfPkE/s72-c/Shaniwarwada.jpg" height="72" width="72"/><thr:total>1</thr:total></entry></feed>