Sorry guys, I forgot to post to the list as well..

-----Original Message-----
From: Lachlan Mulcahy [mailto:[EMAIL PROTECTED]
Sent: Friday, 6 August 2004 4:12 PM
To: [EMAIL PROTECTED]
Subject: RE: Table query and column overlap



Hi again,

To fix this wrapping you can use the \G command, this will display the
output vertically instead of horizontally in columns as your paste below..
To use this you replace the semicolon character ';' with a '\G'

Example:
SELECT * FROM myTable\G

Note: If you are expecting more than a few rows you will want to make sure
you use a LIMIT on your query otherwise you are going to get a LOT of text.

Other than the \G command you could either select less fields in your select
(ie. specify only the columns you need instead of *) or make your terminal
window wider.. unfortunately the command prompt program (cmd.exe) that comes
with most of the modern Windows OS' will not allow you to change the width
of the screen. To combat this you can redirect the output of the mysql
command line client into a file and view it in a program of your choice.

You can do this by using the 'tee' or '\T' command.. This will append all
queries sent to the server and their output to an output file.

Use this by :
\T <filename>

Example:
\T c:/mydirectory/outputfile.txt
or
tee outputfile.txt

To turn off this functionality use 'notee' or '\t'.

If you want the structure of the table, which is what I suspect you are
really looking for here, you will need to do what is called a describe. This
is done by: DESC <tablename>; By doing a select *, you are returning the
entirety of the table's data,.. while it will let you know how many fields
there are and their names, it will not tell you more detailed information
like the data types, if there are indexes, etc.

For more information on retrieving information on tables in this way check
out:
http://dev.mysql.com/doc/mysql/en/DESCRIBE.html

To help us in answering your previous question, a copy of the output of a
describe on the table involved will be helpful.

Kind Regards,
Lachlan Mulcahy



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, 6 August 2004 1:16 PM
To: [EMAIL PROTECTED]
Subject: Table query and column overlap


Dear Friends,
I am using mysql 4.0.17-nt
I have pasted structure of table below, while managing through command
prompt
using sql without GUI.

Once I use without GUI, via command prompt

select * from quiz
to see contents of full table in  each column
I get overlap of columns as pasted below, how do I fix it. Any guidance,
please.


----------------------------------------------------------------------------
-


sql> select * from quiz;
---+----+---------------------------------------------------------+---------
--
----+------------+---------+-----------------+-----------+
id | q  | question                                                | opt1
    | opt2       | opt3    | answer          | activated |
---+----+---------------------------------------------------------+---------
--
----+------------+---------+-----------------+-----------+
 1 | 1  | Which drug is the  treatment of choice in hypertension? | Loop
dirur
ics | omperazole | heparin | Loop diruretics | 1         |
 2 | q2 |                                                         |
    |            |         |                 | 1         |
 3 |    |                                                         |
    |            |         |                 | 1         |
---+----+---------------------------------------------------------+---------
--
----+------------+---------+-----------------+-----------+
rows in set (0.00 sec)



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to