MySQL Forums
Forum List  »  French

Re: Redirection résultat dans un fichier CSV
Posted by: Radouane Sir
Date: August 23, 2016 09:02AM

Rebonjour,

mysql> SELECT MAX(`Date`) AS `Date`, `Time`, Logginmsg, TokenName FROM authentlog GROUP BY TokenName ORDER BY Date DESC;
+------------+----------+-----------------------+---------------+
| Date | Time | Logginmsg | TokenName |
+------------+----------+-----------------------+---------------+
| 2016-08-19 | 09:22:24 | "New Authentication." | "Rala_YXE" |
| 2016-08-19 | 09:22:24 | "New Authentication." | "EBA_YELL" |
| 2016-08-19 | 09:22:24 | "New Authentication." | "Fred_Lopez" |
| 2016-08-18 | 09:22:24 | "New Authentication." | "Tony_Perez" |
| 2016-08-16 | 09:22:24 | "New Authentication." | "ASAN_DERU" |
| 2016-08-15 | 09:22:24 | "New Authentication." | "OUS_NIER" |
+------------+----------+-----------------------+---------------+


Et avec la clause WHERE:

mysql> SELECT MAX(`Date`) AS `Date`, `Time`, Logginmsg, TokenName FROM authentlog WHERE (TokenName like '%Fred_Lopez%') OR (TokenName like '%Tony_Perez%') GROUP BY TokenName ORDER BY Date DESC;
+------------+----------+-----------------------+---------------+
| Date | Time | Logginmsg | TokenName |
+------------+----------+-----------------------+---------------+
| 2016-08-19 | 09:22:24 | "New Authentication." | "Fred_Lopez" |
| 2016-08-18 | 09:22:24 | "New Authentication." | "Tony_Perez" |
+------------+----------+-----------------------+---------------+
2 rows in set (0.00 sec)

A priori cela répond à mon besoin (sur ma machine de test), à vérifier en prod.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Redirection résultat dans un fichier CSV
505
August 23, 2016 09:02AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.