以下 SQL 语句对应的 linq2sql 语句是什么?
SELECT id, userName
FROM users
WHERE
(SELECT COUNT(*) FROM logins WHERE logins.userId=users.id) > 0
或写成连接:
SELECT id, userName
FROM users
LEFT JOIN logins ON logins.id=(SELECT MIN(id) FROM logins WHERE userId=users.id)
WHERE logins.id IS NOT NULL
谢谢