Solved

SQL tranferring data to a simple excel sheet

Posted on 2011-02-21
9
222 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
ID: 34942485
What do you mean by visualise? If you want to import it, then you can do that.
0
 
LVL 11

Author Comment

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

Expert Comment

by:Rory Archibald
ID: 34942603
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 11

Author Comment

by:Jason210
ID: 34942672
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
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 34942693
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
ID: 34942700
An OBCD driver? You mean I have to actually install that?
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 34942718
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
ID: 34955226
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
ID: 35099079
OK cheers. Sorry for my delay in accepting.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

778 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