【问题标题】:Looking for a way to Query data from MySQL database & write it to a output txt file寻找一种从 MySQL 数据库中查询数据并将其写入输出 txt 文件的方法
【发布时间】:2012-06-27 15:32:17
【问题描述】:

寻找一种从 MySQL 数据库中查询数据并将其写入输出 txt 文件的方法。我正在尝试从远程 Windows 框中查询 Linux 服务器数据库。

MySQL 查询:

mysql -u XXX -pXXX -h ttplxapp-esm01.abc.com -D telalert -e "select max(convert_tz(start_time,\"+00:00\",\"-04:00\")) AS Time,group_concat(username SEPARATOR \" \") AS Contact, message AS Message from sends where convert_tz(start_time,\"+00:00\",\"-4:00\") like \"$query_date%\" group by alert_id order by Time desc ;" 

Java 脚本或脚本将是理想的。

【问题讨论】:

    标签: mysql convert-tz


    【解决方案1】:

    尝试使用INTO OUTFILE 子句的SELECT...FROM 语句。

    SELECT Syntax.

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-05
    • 1970-01-01
    • 1970-01-01
    • 2023-04-03
    相关资源
    最近更新 更多