Solved

SQL tranferring data to a simple excel sheet

Posted on 2011-02-21
9
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Creating and Managing Databases with phpMyAdmin in cPanel.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

733 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