Subject | Sql query question |
---|---|
Author | jasajona |
Post date | 2004-11-16T21:51:20Z |
Hello,
I have query:
select
field1,
(select table2.field1 from table2 where field3=table1.field1),
field3
from
table1
where
field4=6
How this query works? When that subselect (how this subquery is called?)
will be executed, before applying condition field4=6 or after? How many
times this subquery will be executed (for all table1 or just for field4=6
records)? What about performance, what should I avoid writting such
querys?
I have query:
select
field1,
(select table2.field1 from table2 where field3=table1.field1),
field3
from
table1
where
field4=6
How this query works? When that subselect (how this subquery is called?)
will be executed, before applying condition field4=6 or after? How many
times this subquery will be executed (for all table1 or just for field4=6
records)? What about performance, what should I avoid writting such
querys?