Home > database > notexists join in ax 2012 x++

notexists join in ax 2012 x++


you have 2 tables, the first table contains ‘123’ record and the second table do not

the question: how to view table in first table that not contains record in second table

case: I want to know, what item that is not in sales

in basic sql:

declare @dataareaid varchar(4);
set @dataareaid = 'Tes';
select
  distinct
  a.itemid
from
  inventtable a
  left join salesline b
    on a.dataareaid=b.dataareaid
      and a.itemid=b.itemid
where
  a.dataareaid=@dataareaid
  and b.itemid is null
order by 
  a.ITEMID

so, the record will show the item that are not in sales line.

how about in x++ version? we used notexist join

this is the code

select inventtable
  notExists join salesline
    where inventtable.itemid==salesline.itemid

now, the problem is time, how much did it take for loading all these data?

in sql server, it takes for 16ms

20150819-092420150819-0925

when i Tried to test on ax, it loads for 3-4 seconds

Categories: database
  1. No comments yet.
  1. No trackbacks yet.

Please kindly Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: