關於 PHP, Linux, Open Source 及個人生活記載的網誌。
RSS icon
  • 文字模式下格式化 MySQL 輸出

    Posted on July 5th, 2006 Sam Tang 1 comment

    有時文字模式下存取 MySQL 資料庫,如果資料是很長的話,往往輸出的結果會很凌亂。要解決這個問題,只要在 SQL 語句後面加上 "\G" 便可解決,例如原本是寫成這樣的 SQL 語句:

    select * from user;

    改成

    select * from user\G;


     

    One response to “文字模式下格式化 MySQL 輸出”

    1. 謝謝大大提供這麼實用的方式 ^^

    Leave a reply

    *
    To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
    Click to hear an audio file of the anti-spam word