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';
  inventtable a
  left join salesline b
    on a.dataareaid=b.dataareaid
      and a.itemid=b.itemid
  and b.itemid is null
order by 

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


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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: