Thursday, 21 April 2011

SQl Sub Query

select partno,partid from dbo.parts where partno // wil come 1-1000 records
in
(
select partno from PriceExceptions where priceSchedule =@PriceSchedule // partno 1,2
)

select partno,partid from dbo.parts where partno
not in
(
select partno from PriceExceptions where priceSchedule =@PriceSchedule
)

No comments:

Post a Comment