Question: Hi I have been following the [tutorials in youtube](https://www.youtube.com/watch?v=DKuGU5CYV_E&t=159s) it uses CLI container to add an org. Since using CLI container is not recommended to have in production environment how to add an org into the existing network withput using cli container

Answer: 
I think this the simpliest solution...:

```
select top 1 * from MY_VIEW
where lastname = 'Collins' and firstname = 'Frank'
order by dateto desc

```

or more edible:

```
select top 1 * from MY_VIEW
where lastname + ' ' + firstname = 'Collins Frank'
order by dateto desc

```
Try: 

```
SELECT
A.LASTNAME, A.FIRSTNAME, A.DATEFROM, A.DATETO, A.ROOMNUMBER, A.CITY, A.COUNTRY, A.STATUS, A.DAYS
FROM
(SELECT LASTNAME, FIRSTNAME, MAX(DATETO) AS MOST_RECENT_STAY
FROM YOUR_TABLE 
GROUP BY LASTNAME, FIRSTNAME) Z
INNER JOIN
YOUR_TABLE A
ON Z.LASTNAME = A.LASTNAME AND Z.FIRSTNAME = A.FIRSTNAME AND Z.MOST_RECENT_STAY = A.DATETO;

```