SQL tranferring data to a simple excel sheet

I need to "visualise" some SQL data in Excel - I've no clue how to do it can anyone help?

Cheers!
LVL 11
Jason210Asked:
Who is Participating?
 
Scott MadeiraConnect With a Mentor Commented:
If you can run a select query on the table then you can do something like this to get a CSV file called result.txt:

SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt'
  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
  LINES TERMINATED BY '\n'
  FROM test_table;


This is an example from the MySQL manual:

http://dev.mysql.com/doc/refman/5.0/en/select.html

After you get the file you can open it in Excel.
0
 
Rory ArchibaldConnect With a Mentor Commented:
What do you mean by visualise? If you want to import it, then you can do that.
0
 
Jason210Author Commented:
I want to export it to an existing Excel file.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Rory ArchibaldCommented:
Assuming you have an ODBC driver for MySQL you can set up a data query in the worksheet to extract the data directly. Exact instructions will depend on which version of Excel.
0
 
Jason210Author Commented:
Well I can choose the format of the Excel file. Let's say I saved the Excel file as an Excel 97 - 2003 Worksheet?

0
 
Rory ArchibaldCommented:
No, the instructions differ according to the version of Excel you are running, not according to the file format, since it's a question of which menu commands to use in Excel.
0
 
Jason210Author Commented:
An OBCD driver? You mean I have to actually install that?
0
 
Rory ArchibaldCommented:
Yes, if you don't already have one. You may be able to do an export from MySQL directly too - that's not my field. ;)
0
 
Jason210Author Commented:
OK cheers. Sorry for my delay in accepting.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.