MySQL Forums
Forum List  »  French

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

Donc la sous-requête contiendra toutes les clauses WHERE concernant les 200 utilisateurs

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

C'est plus propre niveau code mais suit le même raisonnement c'est à dire renseigner en dur les 200 utilisateurs dans des clauses WHERE ??

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Redirection résultat dans un fichier CSV
451
August 24, 2016 02:25AM


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.