MySQL equivalent to *nix 'more'

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gnurp Gnarp

    MySQL equivalent to *nix 'more'

    How do I prevent the MySQL client to scroll pages when the results of
    a query exceeds the number of lines in the terminal window?

    Like a MySQL equivalent to *nix 'more'.

    mysql> select foo from bar;
    [...]

    2500 rows in set (0.00 sec)


    --

  • Thomas Bartkus

    #2
    Re: MySQL equivalent to *nix 'more'

    "Gnurp Gnarp" <gnurpgnarp7555 4@hotmail.com> wrote in message
    news:1106837102 .073109.100430@ f14g2000cwb.goo glegroups.com.. .[color=blue]
    > How do I prevent the MySQL client to scroll pages when the results of
    > a query exceeds the number of lines in the terminal window?
    >
    > Like a MySQL equivalent to *nix 'more'.
    >
    > mysql> select foo from bar;
    > [...]
    >[/color]

    Read up on LIMIT.

    You can pass it a number of rows to skip over as well as the number of rows
    to retrieve.
    This allows you to paginate through large tables 50 (or whatever) records at
    a time.

    Thomas Bartkus


    Comment

    • MikeA

      #3
      Re: MySQL equivalent to *nix 'more'

      You can use the pager command '\P' to set the paging program:

      MySQL>\P more

      will use the OS's 'more' command to page the output.


      Regards,

      Mike Argy
      Custom Office Solutions
      and UNIX/Windows applications



      On Thu, 27 Jan 2005 06:45:02 -0800, Gnurp Gnarp wrote:
      [color=blue]
      > How do I prevent the MySQL client to scroll pages when the results of
      > a query exceeds the number of lines in the terminal window?
      >
      > Like a MySQL equivalent to *nix 'more'.
      >
      > mysql> select foo from bar;
      > [...]
      >
      > 2500 rows in set (0.00 sec)
      >
      >
      > --[/color]

      Comment

      Working...