The Artima Developer Community
Sponsored Link

Python Buzz Forum
MySQL tips

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Rob Hudson

Posts: 17
Nickname: robhudson
Registered: Aug, 2003

Rob Hudson is a Python newbie writing with PHP and Perl backgrounds.
MySQL tips Posted: Nov 27, 2003 3:23 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Rob Hudson.
Original Post: MySQL tips
Feed Title: Thoughts from Rob Hudson
Feed URL: http://treborhudson.blogspot.com/
Feed Description: PHP, Python, Linux, Web
Latest Python Buzz Posts
Latest Python Buzz Posts by Rob Hudson
Latest Posts From Thoughts from Rob Hudson

Advertisement

I've been studying recently for the MySQL certification test and have discovered a few tricks along the way. One of my favorites is the combination of using pager and vertical output.

To set your pager to use less:

mysql> pager less
PAGER set to less

Now when you perform a select which returns more rows than rows on your screen, the pager will allow you to paginate through the results.

To get MySQL to display results vertically instead of in columns horizontally, end your SQL with "\G" instead of with the semicolon (or "\g")...

mysql> SELECT * FROM mails WHERE LENGTH(txt) < 300 lIMIT 300,1\G
*************************** 1. row ***************************
  msg_nro: 3068
     date: 2000-03-01 23:29:50
time_zone: +0200
mail_from: Monty
    reply: monty@no.spam.com
  mail_to: "Thimble Smith" 
      sbj: UTF-8
      txt: >>>>> "Thimble" == Thimble Smith writes:

Thimble> Hi.  I think this is a good idea.  Is anyone familiar with UTF-8
Thimble> or Unicode? Otherwise, I'll put this on my TODO list and see what
Thimble> happens.

Yes, please do that.

Regards,
Monty
     file: inbox-jani-1
     hash: 190402944
1 row in set (0.09 sec)

Read: MySQL tips

Topic: ZEO Presentation Previous Topic   Next Topic Topic: Proofs, Types, and Java Integration

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use