Solved

SQL tranferring data to a simple excel sheet

Posted on 2011-02-21
9
216 Views
Last Modified: 2012-06-27
I need to "visualise" some SQL data in Excel - I've no clue how to do it can anyone help?

Cheers!
0
Comment
Question by:Jason210
  • 4
  • 4
9 Comments
 
LVL 85

Assisted Solution

by:Rory Archibald
Rory Archibald earned 250 total points
Comment Utility
What do you mean by visualise? If you want to import it, then you can do that.
0
 
LVL 11

Author Comment

by:Jason210
Comment Utility
I want to export it to an existing Excel file.
0
 
LVL 85

Expert Comment

by:Rory Archibald
Comment Utility
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
 
LVL 11

Author Comment

by:Jason210
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 85

Expert Comment

by:Rory Archibald
Comment Utility
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
 
LVL 11

Author Comment

by:Jason210
Comment Utility
An OBCD driver? You mean I have to actually install that?
0
 
LVL 85

Expert Comment

by:Rory Archibald
Comment Utility
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
 
LVL 14

Accepted Solution

by:
Scott Madeira earned 250 total points
Comment Utility
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
 
LVL 11

Author Comment

by:Jason210
Comment Utility
OK cheers. Sorry for my delay in accepting.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Creating and Managing Databases with phpMyAdmin in cPanel.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now