Try with this WHERE clause: In the first script the property of labelA is listed as 'A' and not 'id'
WHERE b.Publication = a.A
Try with this WHERE clause: In the first script the property of labelA is listed as 'A' and not 'id'
WHERE b.Publication = a.A