Thursday, March 29, 2012

alternate to "NOT IN " query

any better way of writing this
Select serialnumber from tbl_test2
where serialnumber
not in (select serialnumber from tbl_test) and
exportedflag=0Vikram
Select serialnumber from tbl_test2
where not exists
(select * from tbl_test where tbl_test.serialnumber
=tbl_test2.serialnumber )
and exportedflag=0
"Vikram" <aa@.aa> wrote in message
news:OE88tbrBGHA.3396@.tk2msftngp13.phx.gbl...
> any better way of writing this
> Select serialnumber from tbl_test2
> where serialnumber
> not in (select serialnumber from tbl_test) and
> exportedflag=0
>|||Also:
Select SerialNumber from tbl_test2
left join tbl_test on tbl_test2.SerialNumber = tbl_test.SerialNumber
where tbl_test.serialNumber is null and exportedFlag=0
"Vikram" <aa@.aa> wrote in message
news:OE88tbrBGHA.3396@.tk2msftngp13.phx.gbl...
> any better way of writing this
> Select serialnumber from tbl_test2
> where serialnumber
> not in (select serialnumber from tbl_test) and
> exportedflag=0
>

No comments:

Post a Comment