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

Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page