HI:
I am wandering why would the first take a lot longer then the second query in proc sql , the difference is noted in NOTE DIFFERENCE comment.
:
/*Query 1 */
proc sql;
select a.id,
b.name
from transactions as a ,
person as b
where
a.id = b.id
and
b.seq = (
select max(sub.seq)
from person as sub
where b.id = sub.id /*NOTE DIFFERENCE*/
)
quit;
/*Query 2 */
proc sql;
select a.id,
b.name
from transactions as a ,
person as b
where
a.id = b.id
and
b.seq = (
select max(sub.seq)
from person as sub
where a.id = sub.id /*NOTE DIFFERENCE*/
)
quit;