Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

does derive table use where clause fillters inside

$
0
0

dear all.

Table "A" has two cols aid and col1 , aid is pk.

Table "B" has two cols  bid , aid , and colb .

followin query can be formulated in other ways ,but i wanted to ask something about query processing.

select aid,aa.ca,aa.cb

from A

left join

(select aid, b.colb ca ,b1.colb  cb

 from A

left join B on a.aid=b.aid and b.colb='r'

left join B b1 on a.aid=b1.aid and b1.colb='e'

) aa

where a.aid (1,2)

i wanted to know if i put the where clause "where a.aid(1,2) in side derived table aa

then will it change its plan in any case or it is sufficant to put where clasue in last

or i should put the where clause in side the derive table "aa" also.

yours sincerley


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>