How to split string in SQL Server? [duplicate]2019 Community Moderator ElectionTurning a Comma Separated string into individual rowsHow do I split a string so I can access item x?Using T-SQL, return nth delimited element from a stringHow do I split a string so I can access item x?Add a column with a default value to an existing table in SQL ServerHow to return only the Date from a SQL Server DateTime datatypeHow to check if a column exists in a SQL Server table?Check if table exists in SQL ServerHow to concatenate text from multiple rows into a single text string in SQL server?LEFT JOIN vs. LEFT OUTER JOIN in SQL ServerSQL Server: How to Join to first rowHow do I UPDATE from a SELECT in SQL Server?How to Delete using INNER JOIN with SQL Server?

Getting the || sign while using Kurier

How to resolve: Reviewer #1 says remove section X vs. Reviewer #2 says expand section X

From an axiomatic set theoric approach why can we take uncountable unions?

Expressing logarithmic equations without logs

Why do we say ‘pairwise disjoint’, rather than ‘disjoint’?

Specifying a starting column with colortbl package and xcolor

Why does cron require MTA for logging?

Why aren't there more Gauls like Obelix?

Haman going to the second feast dirty

What is the generally accepted pronunciation of “topoi”?

Outlet with 3 sets of wires

PTIJ: Why does only a Shor Tam ask at the Seder, and not a Shor Mu'ad?

Is it safe to abruptly remove Arduino power?

Shifting between bemols (flats) and diesis (sharps)in the key signature

Can we track matter through time by looking at different depths in space?

Does a difference of tense count as a difference of meaning in a minimal pair?

School performs periodic password audits. Is my password compromised?

What is Tony Stark injecting into himself in Iron Man 3?

What is this diamond of every day?

Is it a Cyclops number? "Nobody" knows!

When a wind turbine does not produce enough electricity how does the power company compensate for the loss?

Plausibility of Mushroom Buildings

What is better: yes / no radio, or simple checkbox?

What can I do if someone tampers with my SSH public key?



How to split string in SQL Server? [duplicate]



2019 Community Moderator ElectionTurning a Comma Separated string into individual rowsHow do I split a string so I can access item x?Using T-SQL, return nth delimited element from a stringHow do I split a string so I can access item x?Add a column with a default value to an existing table in SQL ServerHow to return only the Date from a SQL Server DateTime datatypeHow to check if a column exists in a SQL Server table?Check if table exists in SQL ServerHow to concatenate text from multiple rows into a single text string in SQL server?LEFT JOIN vs. LEFT OUTER JOIN in SQL ServerSQL Server: How to Join to first rowHow do I UPDATE from a SELECT in SQL Server?How to Delete using INNER JOIN with SQL Server?










0
















This question already has an answer here:



  • Turning a Comma Separated string into individual rows

    14 answers



I have a string like "How are you john?". I need to split the string based on user input index. The problem is words need not to split.



Example:



  • Input Query : How are you john?

  • Split Index : 5

I am getting output like this:



How are you john?


Expected output:



How
are
you
john?









share|improve this question















marked as duplicate by Gábor Bakos, Larnu sql-server
Users with the  sql-server badge can single-handedly close sql-server questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 7 at 10:59


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • 1





    Please post your code.

    – Dale Burrell
    Mar 7 at 5:20






  • 1





    Ideally, do string processing in a general purpose programming language with good string manipulation facilities. Not T-SQL. As it is, I've got no idea what the relevance of "Split Index : 5" is - you don't seem to use it anywhere else in the question and the two answers posted so far seem to ignore it also.

    – Damien_The_Unbeliever
    Mar 7 at 7:31












  • @Gowdham check my answer

    – Almazini
    2 days ago















0
















This question already has an answer here:



  • Turning a Comma Separated string into individual rows

    14 answers



I have a string like "How are you john?". I need to split the string based on user input index. The problem is words need not to split.



Example:



  • Input Query : How are you john?

  • Split Index : 5

I am getting output like this:



How are you john?


Expected output:



How
are
you
john?









share|improve this question















marked as duplicate by Gábor Bakos, Larnu sql-server
Users with the  sql-server badge can single-handedly close sql-server questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 7 at 10:59


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • 1





    Please post your code.

    – Dale Burrell
    Mar 7 at 5:20






  • 1





    Ideally, do string processing in a general purpose programming language with good string manipulation facilities. Not T-SQL. As it is, I've got no idea what the relevance of "Split Index : 5" is - you don't seem to use it anywhere else in the question and the two answers posted so far seem to ignore it also.

    – Damien_The_Unbeliever
    Mar 7 at 7:31












  • @Gowdham check my answer

    – Almazini
    2 days ago













0












0








0









This question already has an answer here:



  • Turning a Comma Separated string into individual rows

    14 answers



I have a string like "How are you john?". I need to split the string based on user input index. The problem is words need not to split.



Example:



  • Input Query : How are you john?

  • Split Index : 5

I am getting output like this:



How are you john?


Expected output:



How
are
you
john?









share|improve this question

















This question already has an answer here:



  • Turning a Comma Separated string into individual rows

    14 answers



I have a string like "How are you john?". I need to split the string based on user input index. The problem is words need not to split.



Example:



  • Input Query : How are you john?

  • Split Index : 5

I am getting output like this:



How are you john?


Expected output:



How
are
you
john?




This question already has an answer here:



  • Turning a Comma Separated string into individual rows

    14 answers







sql-server






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 at 5:20









Suraj Kumar

2,6943825




2,6943825










asked Mar 7 at 5:07









GowdhamGowdham

3516




3516




marked as duplicate by Gábor Bakos, Larnu sql-server
Users with the  sql-server badge can single-handedly close sql-server questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 7 at 10:59


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Gábor Bakos, Larnu sql-server
Users with the  sql-server badge can single-handedly close sql-server questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 7 at 10:59


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









  • 1





    Please post your code.

    – Dale Burrell
    Mar 7 at 5:20






  • 1





    Ideally, do string processing in a general purpose programming language with good string manipulation facilities. Not T-SQL. As it is, I've got no idea what the relevance of "Split Index : 5" is - you don't seem to use it anywhere else in the question and the two answers posted so far seem to ignore it also.

    – Damien_The_Unbeliever
    Mar 7 at 7:31












  • @Gowdham check my answer

    – Almazini
    2 days ago












  • 1





    Please post your code.

    – Dale Burrell
    Mar 7 at 5:20






  • 1





    Ideally, do string processing in a general purpose programming language with good string manipulation facilities. Not T-SQL. As it is, I've got no idea what the relevance of "Split Index : 5" is - you don't seem to use it anywhere else in the question and the two answers posted so far seem to ignore it also.

    – Damien_The_Unbeliever
    Mar 7 at 7:31












  • @Gowdham check my answer

    – Almazini
    2 days ago







1




1





Please post your code.

– Dale Burrell
Mar 7 at 5:20





Please post your code.

– Dale Burrell
Mar 7 at 5:20




1




1





Ideally, do string processing in a general purpose programming language with good string manipulation facilities. Not T-SQL. As it is, I've got no idea what the relevance of "Split Index : 5" is - you don't seem to use it anywhere else in the question and the two answers posted so far seem to ignore it also.

– Damien_The_Unbeliever
Mar 7 at 7:31






Ideally, do string processing in a general purpose programming language with good string manipulation facilities. Not T-SQL. As it is, I've got no idea what the relevance of "Split Index : 5" is - you don't seem to use it anywhere else in the question and the two answers posted so far seem to ignore it also.

– Damien_The_Unbeliever
Mar 7 at 7:31














@Gowdham check my answer

– Almazini
2 days ago





@Gowdham check my answer

– Almazini
2 days ago












2 Answers
2






active

oldest

votes


















0














You can try this.



Create Table tblData (inputString Varchar(50)); 
Insert Into tblData Values('How are you john?')

SELECT
Split.a.value('.', 'VARCHAR(100)') AS String
FROM (SELECT
CAST ('<M>' + REPLACE([inputString], ' ', '</M><M>') + '</M>' AS XML) AS String
FROM tblData) AS A CROSS APPLY String.nodes ('/M') AS Split(a);





share|improve this answer























  • This is dangerous, if your string could include forbidden characters. You might read this to find an enhancement. As an alternative you can wrap the text in a CDATA section.

    – Shnugo
    Mar 7 at 8:39












  • @Shnugo Thanks I will check it later.

    – Suraj Kumar
    Mar 7 at 8:50


















0














There is very good function STRING_SPLIT:



SELECT * 
FROM STRING_SPLIT ('How are you john?', ' ') AS cs;


This will give you desired output.



Second parameter can be anything you like e.g. ',' or ''



SQL fiddle






share|improve this answer























  • Worth to mention, that STRING_SPLIT() will need v2016+ and that the result is not guaranteed to be returned in the given order. Quite a draw back... There is a workaround calling OPENJSON (needs v2016+ as well). And there are several approaches for versions below v2016

    – Shnugo
    Mar 7 at 8:37











  • @Shnugo yes you are right that is why I added link to documentation. Do you know when order will be different? I have never had a case.

    – Almazini
    Mar 7 at 8:41











  • Well - uhm - no ;-) The point is: It is not guaranteed. The only fact guaranteed is: The sorting of a resultset is random without an explicit ORDER BY on the outermost query. In fact I'm pretty sure, that this will work in most cases. But (if you return a larger set), the engine might decide to work this down in parallel. Or if the egine decides to re-sort your set to perform a join operation, this might be changed...

    – Shnugo
    Mar 7 at 10:03











  • @Shnugo well I think it is caused by fact that any result-set returned by SELECT (without ORDER BY clause) theoretically doesn't have guaranteed order and may be different in different conditions. Since here we also get result-set it behaves similarly ... in theory :)

    – Almazini
    Mar 7 at 10:32











  • Yes, that's exactly the point: We know for sure, that the result set can be in any order. Very often we use an approach in various places. Just imagine, you find this reliably working in all tested cases and then create a VIEW or an iTVF using this and you call this in another query. Later steps migth mess it up... I'd just not rely on something potentially random...

    – Shnugo
    Mar 7 at 10:45

















2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














You can try this.



Create Table tblData (inputString Varchar(50)); 
Insert Into tblData Values('How are you john?')

SELECT
Split.a.value('.', 'VARCHAR(100)') AS String
FROM (SELECT
CAST ('<M>' + REPLACE([inputString], ' ', '</M><M>') + '</M>' AS XML) AS String
FROM tblData) AS A CROSS APPLY String.nodes ('/M') AS Split(a);





share|improve this answer























  • This is dangerous, if your string could include forbidden characters. You might read this to find an enhancement. As an alternative you can wrap the text in a CDATA section.

    – Shnugo
    Mar 7 at 8:39












  • @Shnugo Thanks I will check it later.

    – Suraj Kumar
    Mar 7 at 8:50















0














You can try this.



Create Table tblData (inputString Varchar(50)); 
Insert Into tblData Values('How are you john?')

SELECT
Split.a.value('.', 'VARCHAR(100)') AS String
FROM (SELECT
CAST ('<M>' + REPLACE([inputString], ' ', '</M><M>') + '</M>' AS XML) AS String
FROM tblData) AS A CROSS APPLY String.nodes ('/M') AS Split(a);





share|improve this answer























  • This is dangerous, if your string could include forbidden characters. You might read this to find an enhancement. As an alternative you can wrap the text in a CDATA section.

    – Shnugo
    Mar 7 at 8:39












  • @Shnugo Thanks I will check it later.

    – Suraj Kumar
    Mar 7 at 8:50













0












0








0







You can try this.



Create Table tblData (inputString Varchar(50)); 
Insert Into tblData Values('How are you john?')

SELECT
Split.a.value('.', 'VARCHAR(100)') AS String
FROM (SELECT
CAST ('<M>' + REPLACE([inputString], ' ', '</M><M>') + '</M>' AS XML) AS String
FROM tblData) AS A CROSS APPLY String.nodes ('/M') AS Split(a);





share|improve this answer













You can try this.



Create Table tblData (inputString Varchar(50)); 
Insert Into tblData Values('How are you john?')

SELECT
Split.a.value('.', 'VARCHAR(100)') AS String
FROM (SELECT
CAST ('<M>' + REPLACE([inputString], ' ', '</M><M>') + '</M>' AS XML) AS String
FROM tblData) AS A CROSS APPLY String.nodes ('/M') AS Split(a);






share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 7 at 5:36









Suraj KumarSuraj Kumar

2,6943825




2,6943825












  • This is dangerous, if your string could include forbidden characters. You might read this to find an enhancement. As an alternative you can wrap the text in a CDATA section.

    – Shnugo
    Mar 7 at 8:39












  • @Shnugo Thanks I will check it later.

    – Suraj Kumar
    Mar 7 at 8:50

















  • This is dangerous, if your string could include forbidden characters. You might read this to find an enhancement. As an alternative you can wrap the text in a CDATA section.

    – Shnugo
    Mar 7 at 8:39












  • @Shnugo Thanks I will check it later.

    – Suraj Kumar
    Mar 7 at 8:50
















This is dangerous, if your string could include forbidden characters. You might read this to find an enhancement. As an alternative you can wrap the text in a CDATA section.

– Shnugo
Mar 7 at 8:39






This is dangerous, if your string could include forbidden characters. You might read this to find an enhancement. As an alternative you can wrap the text in a CDATA section.

– Shnugo
Mar 7 at 8:39














@Shnugo Thanks I will check it later.

– Suraj Kumar
Mar 7 at 8:50





@Shnugo Thanks I will check it later.

– Suraj Kumar
Mar 7 at 8:50













0














There is very good function STRING_SPLIT:



SELECT * 
FROM STRING_SPLIT ('How are you john?', ' ') AS cs;


This will give you desired output.



Second parameter can be anything you like e.g. ',' or ''



SQL fiddle






share|improve this answer























  • Worth to mention, that STRING_SPLIT() will need v2016+ and that the result is not guaranteed to be returned in the given order. Quite a draw back... There is a workaround calling OPENJSON (needs v2016+ as well). And there are several approaches for versions below v2016

    – Shnugo
    Mar 7 at 8:37











  • @Shnugo yes you are right that is why I added link to documentation. Do you know when order will be different? I have never had a case.

    – Almazini
    Mar 7 at 8:41











  • Well - uhm - no ;-) The point is: It is not guaranteed. The only fact guaranteed is: The sorting of a resultset is random without an explicit ORDER BY on the outermost query. In fact I'm pretty sure, that this will work in most cases. But (if you return a larger set), the engine might decide to work this down in parallel. Or if the egine decides to re-sort your set to perform a join operation, this might be changed...

    – Shnugo
    Mar 7 at 10:03











  • @Shnugo well I think it is caused by fact that any result-set returned by SELECT (without ORDER BY clause) theoretically doesn't have guaranteed order and may be different in different conditions. Since here we also get result-set it behaves similarly ... in theory :)

    – Almazini
    Mar 7 at 10:32











  • Yes, that's exactly the point: We know for sure, that the result set can be in any order. Very often we use an approach in various places. Just imagine, you find this reliably working in all tested cases and then create a VIEW or an iTVF using this and you call this in another query. Later steps migth mess it up... I'd just not rely on something potentially random...

    – Shnugo
    Mar 7 at 10:45















0














There is very good function STRING_SPLIT:



SELECT * 
FROM STRING_SPLIT ('How are you john?', ' ') AS cs;


This will give you desired output.



Second parameter can be anything you like e.g. ',' or ''



SQL fiddle






share|improve this answer























  • Worth to mention, that STRING_SPLIT() will need v2016+ and that the result is not guaranteed to be returned in the given order. Quite a draw back... There is a workaround calling OPENJSON (needs v2016+ as well). And there are several approaches for versions below v2016

    – Shnugo
    Mar 7 at 8:37











  • @Shnugo yes you are right that is why I added link to documentation. Do you know when order will be different? I have never had a case.

    – Almazini
    Mar 7 at 8:41











  • Well - uhm - no ;-) The point is: It is not guaranteed. The only fact guaranteed is: The sorting of a resultset is random without an explicit ORDER BY on the outermost query. In fact I'm pretty sure, that this will work in most cases. But (if you return a larger set), the engine might decide to work this down in parallel. Or if the egine decides to re-sort your set to perform a join operation, this might be changed...

    – Shnugo
    Mar 7 at 10:03











  • @Shnugo well I think it is caused by fact that any result-set returned by SELECT (without ORDER BY clause) theoretically doesn't have guaranteed order and may be different in different conditions. Since here we also get result-set it behaves similarly ... in theory :)

    – Almazini
    Mar 7 at 10:32











  • Yes, that's exactly the point: We know for sure, that the result set can be in any order. Very often we use an approach in various places. Just imagine, you find this reliably working in all tested cases and then create a VIEW or an iTVF using this and you call this in another query. Later steps migth mess it up... I'd just not rely on something potentially random...

    – Shnugo
    Mar 7 at 10:45













0












0








0







There is very good function STRING_SPLIT:



SELECT * 
FROM STRING_SPLIT ('How are you john?', ' ') AS cs;


This will give you desired output.



Second parameter can be anything you like e.g. ',' or ''



SQL fiddle






share|improve this answer













There is very good function STRING_SPLIT:



SELECT * 
FROM STRING_SPLIT ('How are you john?', ' ') AS cs;


This will give you desired output.



Second parameter can be anything you like e.g. ',' or ''



SQL fiddle







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 7 at 7:17









AlmaziniAlmazini

95921739




95921739












  • Worth to mention, that STRING_SPLIT() will need v2016+ and that the result is not guaranteed to be returned in the given order. Quite a draw back... There is a workaround calling OPENJSON (needs v2016+ as well). And there are several approaches for versions below v2016

    – Shnugo
    Mar 7 at 8:37











  • @Shnugo yes you are right that is why I added link to documentation. Do you know when order will be different? I have never had a case.

    – Almazini
    Mar 7 at 8:41











  • Well - uhm - no ;-) The point is: It is not guaranteed. The only fact guaranteed is: The sorting of a resultset is random without an explicit ORDER BY on the outermost query. In fact I'm pretty sure, that this will work in most cases. But (if you return a larger set), the engine might decide to work this down in parallel. Or if the egine decides to re-sort your set to perform a join operation, this might be changed...

    – Shnugo
    Mar 7 at 10:03











  • @Shnugo well I think it is caused by fact that any result-set returned by SELECT (without ORDER BY clause) theoretically doesn't have guaranteed order and may be different in different conditions. Since here we also get result-set it behaves similarly ... in theory :)

    – Almazini
    Mar 7 at 10:32











  • Yes, that's exactly the point: We know for sure, that the result set can be in any order. Very often we use an approach in various places. Just imagine, you find this reliably working in all tested cases and then create a VIEW or an iTVF using this and you call this in another query. Later steps migth mess it up... I'd just not rely on something potentially random...

    – Shnugo
    Mar 7 at 10:45

















  • Worth to mention, that STRING_SPLIT() will need v2016+ and that the result is not guaranteed to be returned in the given order. Quite a draw back... There is a workaround calling OPENJSON (needs v2016+ as well). And there are several approaches for versions below v2016

    – Shnugo
    Mar 7 at 8:37











  • @Shnugo yes you are right that is why I added link to documentation. Do you know when order will be different? I have never had a case.

    – Almazini
    Mar 7 at 8:41











  • Well - uhm - no ;-) The point is: It is not guaranteed. The only fact guaranteed is: The sorting of a resultset is random without an explicit ORDER BY on the outermost query. In fact I'm pretty sure, that this will work in most cases. But (if you return a larger set), the engine might decide to work this down in parallel. Or if the egine decides to re-sort your set to perform a join operation, this might be changed...

    – Shnugo
    Mar 7 at 10:03











  • @Shnugo well I think it is caused by fact that any result-set returned by SELECT (without ORDER BY clause) theoretically doesn't have guaranteed order and may be different in different conditions. Since here we also get result-set it behaves similarly ... in theory :)

    – Almazini
    Mar 7 at 10:32











  • Yes, that's exactly the point: We know for sure, that the result set can be in any order. Very often we use an approach in various places. Just imagine, you find this reliably working in all tested cases and then create a VIEW or an iTVF using this and you call this in another query. Later steps migth mess it up... I'd just not rely on something potentially random...

    – Shnugo
    Mar 7 at 10:45
















Worth to mention, that STRING_SPLIT() will need v2016+ and that the result is not guaranteed to be returned in the given order. Quite a draw back... There is a workaround calling OPENJSON (needs v2016+ as well). And there are several approaches for versions below v2016

– Shnugo
Mar 7 at 8:37





Worth to mention, that STRING_SPLIT() will need v2016+ and that the result is not guaranteed to be returned in the given order. Quite a draw back... There is a workaround calling OPENJSON (needs v2016+ as well). And there are several approaches for versions below v2016

– Shnugo
Mar 7 at 8:37













@Shnugo yes you are right that is why I added link to documentation. Do you know when order will be different? I have never had a case.

– Almazini
Mar 7 at 8:41





@Shnugo yes you are right that is why I added link to documentation. Do you know when order will be different? I have never had a case.

– Almazini
Mar 7 at 8:41













Well - uhm - no ;-) The point is: It is not guaranteed. The only fact guaranteed is: The sorting of a resultset is random without an explicit ORDER BY on the outermost query. In fact I'm pretty sure, that this will work in most cases. But (if you return a larger set), the engine might decide to work this down in parallel. Or if the egine decides to re-sort your set to perform a join operation, this might be changed...

– Shnugo
Mar 7 at 10:03





Well - uhm - no ;-) The point is: It is not guaranteed. The only fact guaranteed is: The sorting of a resultset is random without an explicit ORDER BY on the outermost query. In fact I'm pretty sure, that this will work in most cases. But (if you return a larger set), the engine might decide to work this down in parallel. Or if the egine decides to re-sort your set to perform a join operation, this might be changed...

– Shnugo
Mar 7 at 10:03













@Shnugo well I think it is caused by fact that any result-set returned by SELECT (without ORDER BY clause) theoretically doesn't have guaranteed order and may be different in different conditions. Since here we also get result-set it behaves similarly ... in theory :)

– Almazini
Mar 7 at 10:32





@Shnugo well I think it is caused by fact that any result-set returned by SELECT (without ORDER BY clause) theoretically doesn't have guaranteed order and may be different in different conditions. Since here we also get result-set it behaves similarly ... in theory :)

– Almazini
Mar 7 at 10:32













Yes, that's exactly the point: We know for sure, that the result set can be in any order. Very often we use an approach in various places. Just imagine, you find this reliably working in all tested cases and then create a VIEW or an iTVF using this and you call this in another query. Later steps migth mess it up... I'd just not rely on something potentially random...

– Shnugo
Mar 7 at 10:45





Yes, that's exactly the point: We know for sure, that the result set can be in any order. Very often we use an approach in various places. Just imagine, you find this reliably working in all tested cases and then create a VIEW or an iTVF using this and you call this in another query. Later steps migth mess it up... I'd just not rely on something potentially random...

– Shnugo
Mar 7 at 10:45



Popular posts from this blog

Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived