Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SELECT query - problem with SORT

Former Member
0 Likes
1,155

Hi,

Same select query behaves different way on development and quality server

on Development it returns unsorted and Quality returns sorted

it can be resolved by SORT but why does it behave differently

Do you know what is setting in database

thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,107

From F1 on SELECT:

Orders the records in a SELECT statement. Without the ORDER-BY clause, the order
 in which the selected lines are supplied is undefined. This means that two similar SELECT
 statements may produce lines in a different order. 

Rob

6 REPLIES 6
Read only

Former Member
0 Likes
1,107

Can you please tell on what table you getting the sorted result.

Read only

0 Likes
1,107

Fetching data from customer table into internal table

Read only

Former Member
0 Likes
1,107

Hi,

You need to explicitly handle in your ABAP code, nothing to do with database.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
1,108

From F1 on SELECT:

Orders the records in a SELECT statement. Without the ORDER-BY clause, the order
 in which the selected lines are supplied is undefined. This means that two similar SELECT
 statements may produce lines in a different order. 

Rob

Read only

0 Likes
1,107

Thanks . Does ORDER BY clause is a part of database default setting if yes where ?

(same SELECT statement without ORDER BY clause fetches same records but in different order in both server)

Read only

0 Likes
1,107

I don't use the ORDER BY option. I think it's better to have the application do it. I don't know of any way to make it automatic.

Rob