Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2015

    Unanswered: Export huge table as Excel file

    Hi Guys,

    I am a newbie in MySQL,

    I have a table with 18 000 000 records, I have to export records when the value of AcctStartTime's column begins on 01/01/2015 and later as Excel file via command line...

    Any idea please...

    This is a snapshot of table

    Click image for larger version. 

Name:	eeeeeee.JPG 
Views:	5 
Size:	57.7 KB 
ID:	16661

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    Do you actually mean you want to export 18 million rows to an Excel file, or do you you want to export 18 million rows to, say, a CSV file

    to my knowledge excel cannot handle a 18 million row file

    in any event use a query to select waht rows you want and save the output to a file.
    if you need the output in Excel, then send it as chunks of data that Excel can read
    OR import the data directly into an Excel workbook using an ODBC query INSIDE Excel
    .. that assume that you have Access to a MySQL server using the MySQL command line or a SQL tool such as MySQL's own Workbench or similar.

    failing that you could export a query using a scripting language

    or you could could create the required output in the query (using commas and or appropriate delimiters).

    to setup your query its going to be soemthign like
    SELECT my, column, list FROM mytable
    WHERE AcctStartTime >= '2015/01/01'
    replace the italicised words with:-
    the names of your columns (my, column, list)
    the name of your table (mytable)

    you may need to coerce the date literal ('2015/01/01') using the STR_TO_DATE function for the above to work
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts