1
2
3
4
5
6
7
8
9
SELECT A.UserId
FROM
(
      SELECT UserId FROM Users WHERE Email LIKE '%.com'
) A,
(
      SELECT UserId FROM Users WHERE Email LIKE '%er%'
) B
WHERE A.UserId = B.UserId

Result A:

10059
10060
10061
10062
10063
10082
10058
10088
10089

Result B:

10059
10063
10087
10089

Result query:

10059
10063
10089

If there are other ways to acomplish this, please let me know.

Lieven Cardoen aka Johlero

pixel A sort of Subset Union
No TweetBacks yet. (Be the first to Tweet this post)