<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[מיון לפי מספור משפטי SQL SERVER]]></title><description><![CDATA[<p dir="rtl">שלום לכולם<br />
אני צריך למיין עמודה שהיא בעצם סטרינג, אבל עלי להתייחס אליה כאל מספור משפטי (כמו בחוזים שעושים עורכי דין, 1.4.6.8 וכן הלאה) הבעיה: סטרינג כידוע ממויין באופן לא רציונלי כאשר הוא מכיל מספר, כלומר 11 הוא לפני 2 וכן הלאה. אז בשלמא עד היום חינכו אותנו לעשות cast אבל מה יהיה כשהטריק הזה כבר לא עובד??</p>
<p dir="rtl">מקווה שיש למישהו רעיון.</p>
<p dir="rtl">דוגמת קוד:</p>
<pre><code>declare @t table (ContractClause nvarchar(max))
insert @t
values ('1'),('11'),('1.1.3'),('2.1')
select * from @t order by ContractClause
</code></pre>
<p dir="rtl"><em>פורסם במקור בפורום CODE613 ב25/07/2016 19:36 (+03:00)</em></p>
]]></description><link>https://tchumim.com/topic/1077/מיון-לפי-מספור-משפטי-sql-server</link><generator>RSS for Node</generator><lastBuildDate>Wed, 14 Oct 2026 07:01:43 GMT</lastBuildDate><atom:link href="https://tchumim.com/topic/1077.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 29 Jan 2018 11:31:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to מיון לפי מספור משפטי SQL SERVER on Mon, 29 Jan 2018 11:31:45 GMT]]></title><description><![CDATA[<p dir="rtl">רחמים תודה</p>
<p dir="rtl">דווקא התשובה שנמצאת כאן</p>
<p dir="rtl">זאת עם אפס הצבעות, היא הכי פשוטה ויעילה.</p>
<p dir="rtl">הקוד כך:</p>
<pre><code>declare @t table (ContractClause nvarchar(max))
insert @t
values ('1'),('11'),('1.1.3'),('2.1')
select * from @t 
ORDER BY cast('/' + ContractClause + '/' as hierarchyid)
</code></pre>
<p dir="rtl"><em>פורסם במקור בפורום CODE613 ב25/07/2016 23:31 (+03:00)</em></p>
]]></description><link>https://tchumim.com/post/7229</link><guid isPermaLink="true">https://tchumim.com/post/7229</guid><dc:creator><![CDATA[ארכיטקט]]></dc:creator><pubDate>Mon, 29 Jan 2018 11:31:45 GMT</pubDate></item><item><title><![CDATA[Reply to מיון לפי מספור משפטי SQL SERVER on Mon, 29 Jan 2018 11:31:44 GMT]]></title><description><![CDATA[<p dir="rtl">ראה <a href="http://stackoverflow.com/questions/1322552/custom-sorting-function-of-sql-server" target="_blank" rel="noopener noreferrer nofollow ugc">כאן</a><br />
ו<a href="http://stackoverflow.com/questions/528830/sql-sort-by-version-number-a-string-of-varying-length" target="_blank" rel="noopener noreferrer nofollow ugc">כאן</a><br />
ו<a href="http://stackoverflow.com/questions/13315756/how-to-compare-sql-strings-that-hold-version-numbers-like-net-system-version-cl" target="_blank" rel="noopener noreferrer nofollow ugc">כאן</a></p>
<p dir="rtl">ובכלל חיפוש כזה 'SQL SERVER  sort version number string' מביא המון תוצאות</p>
<p dir="rtl"><em>פורסם במקור בפורום CODE613 ב25/07/2016 21:29 (+03:00)</em></p>
]]></description><link>https://tchumim.com/post/7228</link><guid isPermaLink="true">https://tchumim.com/post/7228</guid><dc:creator><![CDATA[רחמים]]></dc:creator><pubDate>Mon, 29 Jan 2018 11:31:44 GMT</pubDate></item><item><title><![CDATA[Reply to מיון לפי מספור משפטי SQL SERVER on Mon, 29 Jan 2018 11:31:44 GMT]]></title><description><![CDATA[<p dir="rtl">להלן תשובות שהן בלתי אפשריות במקרה שלי:<br />
שרשור אפסים מובילים (בלתי אפשרי מסיבה כלשהי, לא ניכנס לזה עכשיו)<br />
פירוק לשדות נפרדים (pivot) עומק העץ איננו ידוע מראש ואיננו ידוע לעולם!!!</p>
<p dir="rtl"><em>פורסם במקור בפורום CODE613 ב25/07/2016 19:44 (+03:00)</em></p>
]]></description><link>https://tchumim.com/post/7227</link><guid isPermaLink="true">https://tchumim.com/post/7227</guid><dc:creator><![CDATA[ארכיטקט]]></dc:creator><pubDate>Mon, 29 Jan 2018 11:31:44 GMT</pubDate></item></channel></rss>