Home > Archive > Oracle Databases > July 2005 > #hints>1?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #hints>1?
bdj

2005-07-21, 1:24 pm

Hello!
Can one give more than one hint in an select-statement?
Greetings
Bjørn


Matthias Hoys

2005-07-21, 8:25 pm


"bdj" <B.D.Jensenremove@gmx.net> wrote in message
news:42dfecef$0$7379
$ba624c82@nntp02.dk.telia.net...
> Hello!
> Can one give more than one hint in an select-statement?
> Greetings
> Bjørn
>


Yes you can.
This is an example from the Oracle 10g docs :

Example 16-1 Specifying a Full Set of Hints

SELECT /*+ LEADING(e2 e1) USE_NL(e1) INDEX(e1 emp_emp_id_pk)
USE_MERGE(j) FULL(j) */
e1.first_name, e1.last_name, j.job_id, sum(e2.salary) total_sal
FROM employees e1, employees e2, job_history j
WHERE e1.employee_id = e2.manager_id
AND e1.employee_id = j.employee_id
AND e1.hire_date = j.start_date
GROUP BY e1.first_name, e1.last_name, j.job_id
ORDER BY total_sal;
HTHMatthias Hoys


bdj

2005-07-21, 8:25 pm

Hi!
Can I also do it in Oracle 8i (yes, yes I know it's desupported - we are
preparing upgrade...)
/Bjørn

"Matthias Hoys" < idmwarpzone_NOSPAM_@
yahoo.com> skrev i en meddelelse
news:42e00493$0$2903
1$ba620e4c@news.skynet.be...
>
> "bdj" <B.D.Jensenremove@gmx.net> wrote in message
> news:42dfecef$0$7379
$ba624c82@nntp02.dk.telia.net...
>
> Yes you can.
> This is an example from the Oracle 10g docs :
>
> Example 16-1 Specifying a Full Set of Hints
>
> SELECT /*+ LEADING(e2 e1) USE_NL(e1) INDEX(e1 emp_emp_id_pk)
> USE_MERGE(j) FULL(j) */
> e1.first_name, e1.last_name, j.job_id, sum(e2.salary) total_sal
> FROM employees e1, employees e2, job_history j
> WHERE e1.employee_id = e2.manager_id
> AND e1.employee_id = j.employee_id
> AND e1.hire_date = j.start_date
> GROUP BY e1.first_name, e1.last_name, j.job_id
> ORDER BY total_sal;
> HTHMatthias Hoys
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com