I have 3 tables in my SQL database as follows

### `Users2`

```
UserID,
EID,
Name,
Email,
Department,
Enabled

```

### `Sites`

```
SiteID,
SiteCode,
SiteName

```

### `UserSites2`

```
UsersSitesID,
UserID,
SiteID

```

What I need to do is, given `EID` and `SiteID`, get a full row from the `Users2` table AND the `SiteID`, `SiteCode` and `SiteName` from the `Sites` table WHEN the `userID` of the retrieved record has an entry in the `UserSites2`

Example of expected result:

### `Users2`

```
1, 12345, Me, me@email.com, Support, True
2, 12346, you, you@email.com, Service, True

```

### `Sites`

```
1, 123, Regional HQ
2, 234, National HQ

```

### `UserSites2`

```
1, 1, 1
2, 1, 2
3, 2, 2

```

So given `EID` `12345` and `SiteID` `2` I should get the result

```
1, 12345, Me, me@email.com, Support, True, 2, 234, National HQ

```

and for `EID` `12346` and `SiteID` `1` I should get nothing

I know how to join `Users2` and `Sites` to get the full row I want but I don't understand how to make it depend on whether there is an entry in the lookup table for it.