I have been looking for solution to export table with specific fields/columns. I am using Ubuntu commandline to do that. Luckily MySQL dump by query help me achieve my goal with
mysql -e "select * from myTable" -u myuser -pxxxxxxxx mydatabase > mydumpfile.txt
But, I am getting plain text file. I want to get file dumped as SQL format. So can I get dumped file with mydumpfile.sql instead of mydumpfile.txt?