If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > order by issue

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-01-07, 15:22
bustacap bustacap is offline
Registered User
 
Join Date: Apr 2007
Posts: 9
order by issue

We executed a dynamic SQL statement (not a complex one) and we have an order by clause at the end of it. This statement does a join of 2 tables. The strange thing is that the order by seem like it doesn't work. The results are not in sequential order.
If we were to do a straight select on just one table (for which we are doing the order by on) everything is ok.

Has anyone experienced this before?
Reply With Quote
  #2 (permalink)  
Old 06-01-07, 15:52
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by bustacap
Has anyone experienced this before?
never

tip: it might be a good idea to show the query that is misbehaving
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 06-01-07, 16:05
bustacap bustacap is offline
Registered User
 
Join Date: Apr 2007
Posts: 9
Thanks. This is my first post on the forum. I guess it shows?

We figured it out. We forgot to put some \'s at the end of last few rows to indicate that the SQL continues on the next line. So it never got to the sort option. Ah... it's Friday.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On