Observe the SQL doesn’t prefix “Id” with table name.
For reference:
SQL: SELECT "UserAuth".*, 0 EOT, "UserAuthRole".*, 0 EOT
FROM "UserAuth" INNER JOIN "UserAuthRole" ON ("UserAuth"."Id" = "UserAuthRole"."UserAuthId")
WHERE "Id" IN (SELECT "UserAuthId"
FROM "UserAuthRole"
GROUP BY "UserAuthId"
HAVING count(1) = @0 )
PARAMS: @0=0
SQL logic error
ambiguous column name: Id
Gist here:
https://gist.cafe/d7b5af41c61697fc83601136446a5872
What I’m trying to do is actually finding all users who have all the roles and permissions queried for. Those will be added to the roles/permissions variables, but perhaps not relevant for the problem at hand. I realize that in Sqlite the query could have been written differently, no need for Sql.In, but it has to work with Sql Server as well.