How to export column in mysql ?

Discussion in 'MySQL' started by Amilo, Jun 6, 2006.

  1. #1
    Please could someont tell me how to export just a column rather than a whole table in mysql ?

    my table has 4 componants:

    Widget ID number
    Widget name
    Date requested
    order number

    I want to export just the Widget names and not the whole table.
     
    Amilo, Jun 6, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The easy way is to use phpmyadmin to dump the entire DB into Excel. Then delete the columns you don't want.
     
    mad4, Jun 6, 2006 IP
  3. chengfu

    chengfu Well-Known Member

    Messages:
    113
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #3
    You might as well use a query like this:
    
    SELECT widgetname INTO OUTFILE '/path/to/export/on/server/names.txt' FROM table
    
    Code (markup):
    The selected column will then be saved to the given path on the server.
     
    chengfu, Jun 6, 2006 IP