![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am getting completely different results with the following query: SELECT scanA.* FROM SCHEDWIN.LOCSCAN scanA WHERE scanA.SCAN_TIME = ( SELECT MAX(scanB.SCAN_TIME) FROM SCHEDWIN.LOCSCAN scanB WHERE scanA.RESID||scanA.LIBENTRYID = scanB.RESID||scanB.LIBENTRYID AND (scanB.SCAN_TIME < ' 1194645483' ) ); ...depending on whether I have OPTIMIZER_HINT set to CHOOSE or FIRST_ROWS! (CHOOSE returns the correct result set, FIRST_ROWS returns nothing.) Can anyone explain why this might be happening and how I can get my desired result set with the CHOOSE option? I am trying to select all the records (for a given RESID/LIBENTRYID combination) that are the LATEST records (according to the SCAN_TIME field) before a certain cutoff value. Thank you! -Aung |
#3
| |||
| |||
|
|
atha... (AT) gmail (DOT) com wrote: I am getting completely different results with the following query: SELECT scanA.* FROM SCHEDWIN.LOCSCAN scanA WHERE scanA.SCAN_TIME = ( SELECT MAX(scanB.SCAN_TIME) FROM SCHEDWIN.LOCSCAN scanB WHERE scanA.RESID||scanA.LIBENTRYID = scanB.RESID||scanB.LIBENTRYID AND (scanB.SCAN_TIME < ' 1194645483' ) ); ...depending on whether I have OPTIMIZER_HINT set to CHOOSE or FIRST_ROWS! (CHOOSE returns the correct result set, FIRST_ROWS returns nothing.) Can anyone explain why this might be happening and how I can get my desired result set with the CHOOSE option? I am trying to select all the records (for a given RESID/LIBENTRYID combination) that are the LATEST records (according to the SCAN_TIME field) before a certain cutoff value. Thank you! -Aung If the CHOOSE option is of interest to you ... you have what antiquated model of 8i or before (4 decimal places please)? -- Daniel A. Morgan Oracle Ace Director & Instructor University of Washington damor...@x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Groupwww.psoug.org- Hide quoted text - - Show quoted text - |
#4
| |||
| |||
|
|
I am getting completely different results with the following query: SELECT scanA.* FROM SCHEDWIN.LOCSCAN scanA WHERE scanA.SCAN_TIME = ( SELECT MAX(scanB.SCAN_TIME) FROM SCHEDWIN.LOCSCAN scanB WHERE scanA.RESID||scanA.LIBENTRYID = scanB.RESID||scanB.LIBENTRYID AND (scanB.SCAN_TIME < ' 1194645483' ) ); ...depending on whether I have OPTIMIZER_HINT set to CHOOSE or FIRST_ROWS! (CHOOSE returns the correct result set, FIRST_ROWS returns nothing.) Can anyone explain why this might be happening and how I can get my desired result set with the CHOOSE option? I am trying to select all the records (for a given RESID/LIBENTRYID combination) that are the LATEST records (according to the SCAN_TIME field) before a certain cutoff value. Thank you! -Aung |
#5
| |||
| |||
|
#6
| |||
| |||
|
|
The Oracle version exhibiting the problem is 8.1.7.0.0. |
|
The problem does NOT show up in 9.2.0.1.0. Ditto. |
#7
| |||
| |||
|
|
The Oracle version exhibiting the problem is 8.1.7.0.0. The problem does NOT show up in 9.2.0.1.0. |
![]() |
| Thread Tools | |
| Display Modes | |
| |