Re: SQL-Frage

Erik Schanze <[email protected]>
Newsgroups gmane.user-groups.linux.dresden
Message-ID <[email protected]>
Am 19.02.22 um 14:08 schrieb Sebastian Weckend:
> Wahrscheinlich wäre es in dem Beispiel besser, ORDER BY id DESC in der
> query und der LAG function zu nutzen. Das funktioniert aber nur, wenn
> die Einträge auch in zeitlicher Reihenfolge geschrieben werden. Wäre
> aber spannend zu wissen.
>
Ich habe keine Spalte 'id', sondern nur:

MariaDB [siemens]> SELECT * FROM log1 ORDER BY created DESC LIMIT 2;
+---------------------+----------+----------+
| created             | c180     | c280     |
+---------------------+----------+----------+
| 2022-02-18 23:58:10 | 11791536 | 17142137 |
| 2022-02-18 23:56:09 | 11791523 | 17142137 |
+---------------------+----------+----------+
2 rows in set (0.001 sec)


Ich werds in PHP lösen, danke trotzdem.


VG,

Erik
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.