Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Hint Help!
Brad Skiles wrote:
> SELECT /*+ INDEX(TRANSACTION TRANSACT_DEPT) */
> AL9.FUND,
> AL9.PROJ,
> AL9.OBJ,
> AL9.AMOUNT,
> AL9.DEPT
> FROM
> TRANSACTION AL9
> WHERE
> AL9.FISC_YR='1996-97' AND
> AL9.DEPT IN ('1330','1333','1335','1336','1337','1338') AND
> AL9.OBJ BETWEEN '52000' AND '52999';
Your problem here is that the hints recognize tables by alias, not
name. your select should be:
SELECT /*+ INDEX(AL9 TRANSACT_DEPT) */
AL9.FUND, AL9.PROJ, AL9.OBJ, AL9.AMOUNT, AL9.DEPT
AL9.FISC_YR='1996-97' AND AL9.DEPT IN ('1330','1333','1335','1336','1337','1338') AND AL9.OBJ BETWEEN '52000' AND '52999';
By the way, chances are that it might work all right even without the index name. That colud be better to give the optimizer some maneuvering space. Anyway, just using the alias instead of the table name as I showed above is sure to work.
Roberto Bruno. Received on Sat May 31 1997 - 00:00:00 CDT
![]() |
![]() |