To clarify my idea:
If i could use left joins i would, but that´s not the point!!
Here I give the tables and the query.
# Server version 4.1.0-alpha-log
#
# Table structure for table 'demandexam'
#
CREATE TABLE demandexam (
sku_code char(3) NOT NULL default '0',
quantity tinyint(3)...
The relation is given by "table2.fieldb=table1.fieldb"
select fielda,
(select table2.fieldc from table2 where
table2.fieldb=table1.fieldb)
from table1
Does anybody know why the explain of a query that contains a nested query shows that the "dependant" query does not use indexes when it should?? Does the query use indexes at all?
ie:
Table1 structure:
fielda :Primary key
fieldb
Table2 structure:
fieldb :Primary key
fieldc
select...
Thanks DaPi, your answer gives a different resultset that mine does. My query returns nulls if the name is not found. Your query would return the names that exist in both tables.
cursor ajm is
select m.name, dt.dept
from master m, depttable dt
where dt.name(+)=m.name;
With this modification...
Anybody knows why i cant compile a Procedure in pl/sql where i have a cursor like this:
cursor ajm is
select m.name,(select dt.dept from depttable dt where dt.name=m.name) from master m;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.