MarkMpn / Sql4Cds

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

Not In With Join not Working #382

Closed daryllabar closed 9 months ago

daryllabar commented 10 months ago

These two statements give different results

SELECT COUNT(*) FROM contact WHERE contactid NOT IN (Select entityid FROM listmember INNER JOIN list ON listmember.listid = list.listid WHERE list.listid = 'c0bb2785-f577-ee11-8179-6045bd006e5a')
SELECT COUNT(*) FROM contact WHERE contactid NOT IN (Select entityid FROM listmember WHERE listid = 'c0bb2785-f577-ee11-8179-6045bd006e5a')

even though the ins give the same results:

Select entityid FROM listmember INNER JOIN list ON listmember.listid = list.listid WHERE list.listid = 'c0bb2785-f577-ee11-8179-6045bd006e5a'
Select entityid FROM listmember WHERE listid = 'c0bb2785-f577-ee11-8179-6045bd006e5a'