Question: My assignment needs to use `tensorflow 1.14.0`, yet it reports:

```
ERROR: Could not find a version that satisfies the requirement tensorflow<1.15.0,>=1.14.0 (from -r requirements.txt (line 3)) (from
versions: 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.0rc4, 2.2.0, 2.2.1,
2.3.0rc0, 2.3.0rc1, 2.3.0rc2, 2.3.0, 2.3.1, 2.4.0rc0, 2.4.0rc1, 2.4.0rc2, 2.4.0rc3, 2.4.0rc4, 2.4.0)

```

It is the same result when I tried to use pip in the console. It seems that old version of `tensorflow` is not supported now, but my assignment requires that old version. Is there a way to download the older version? Or can the `tensorflow` 2 identify the code in `tensorflow 1.14.0`?

Answer: 
You may use `DISTINCT ON` here:

```sql
SELECT DISTINCT ON (TO_CHAR(time, 'YYYY-MM-DD HH:MI')) time, data
FROM yourTable
ORDER BY TO_CHAR(time, 'YYYY-MM-DD HH:MI'), time DESC;

```

[![screen capture from demo link below](https://i.stack.imgur.com/vLVS3.png)](https://i.stack.imgur.com/vLVS3.png)

[Demo
----](https://dbfiddle.uk/?rdbms=postgres_10&fiddle=f068acee5a908dcd0916cab1678c208f)

**Edit:**

Given that you have revealed there might be duplicates, and in that case you would want to retain all of them, we can't use `DISTINCT ON`. Instead, use `RANK` here:

```sql
WITH cte AS (
    SELECT *, RANK() OVER (PARTITION BY TO_CHAR(time, 'YYYY-MM-DD HH:MI')
                           ORDER BY time DESC) rnk
    FROM yourTable
)

SELECT time, data
FROM cte
WHERE rnk = 1;

```

[Demo
----](https://dbfiddle.uk/?rdbms=postgres_10&fiddle=002c3e3d72caed0674dd17cac5152009)
You can also use date\_trunc('minute', time) instead of to\_char() in the query that @TimBiegelesien shared with you.