SQL: Get the first value
<p>I have two tables:</p>

<p>patients(ID, Firstname, Lastname, ...)</p>

<p>records(ID, Date, Time, Version)</p>

<p>I want to (inner) join these tables, so I have the records with patient data, but in the column for Version I want always the first value that was recorded for the patient (so with the minimum of date and time dependent on the patient (id)). I tried with subquery but HANA doesn't allow ORDER-BY or LIMIT clause in subqueries.</p>

<p>How can I implement this with SQL? (HANA SQL)</p>

<p>Kind regards and thanks in advance.</p>