MarkMpn / Sql4Cds

SQL 4 CDS core engine and XrmToolbox tool
MIT License
74 stars 22 forks source link

Inner join with audit does not returns expected result... #488

Closed sybaris closed 2 months ago

sybaris commented 2 months ago

Hi

The following query does not returns correct rows :

select count(*)
from systemuser 
inner join Audit on systemuserid = userid
where systemuserid='...'

image

I take the systemuserid of a user. So I find 1 user in systemuser. This user have 183 rows in audit table. So when we are making an inner join between this 2 datasets, I except to have 183 rows. Instead, we have 1234874 rows. Note that 1234874 is also the number of rows of Audit table...

Regards Sybaris

MarkMpn commented 2 months ago

Thanks for the details. It looks like the server is interpreting the inner joins as outer joins. With some more testing I've found some more attributes that it doesn't seem to support filtering on either, listing them here for my reference to fix shortly: