I have a table. I need to export all the rows for 1 column only. How can I achieve this? I know how to export the whole table but have not find a way to export a single columns data.
If you want to select only specific columns, replace the * with the names of the columns, separated by commas. The following statement selects just the name_id, firstname and lastname fields from the master_name table.
Show activity on this post. open the table from which you want to export only certain column , click on structure , tick mark on check box of that column , click on browse button ! after that it will show you your column data , below their is written export button click on it !
Select Miscellaneous > File Export > General or Configuration > External > Export Files to access the Export File List screen. Select the export from the list and select the Edit button to access the Export File Details screen. Select the Export Columns button. The Export Column Details screen appears.
MySQL SELECT statement is used to retrieve rows from one or more tables. The statement can also include UNION statements and subqueries. SELECT statement is used to fetch rows or records from one or more tables.
This query should work(Use SELECT INTO OUTFILE 'file_name')-
SELECT `column` FROM `table` INTO OUTFILE 'file_name'
Refer this.
You can do it very easily using MySQL GUI tools like SQLyog, PHPMyAdmin. In SQLyog you just need to select the table, Click on "Export As..." Icon and you will get dialog to select the columns that you want to Export. Then click on "Export Button". Export is done...
Here is the screen shot showing export of column "city" in XML format.
Hope it helps...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With