if we want to load data from a text file into a mysql table,
but the columns in table are 1st: code(int) and 2nd:
city(varchar), but in text file the format is 1st cityname
and then code separeted by delimeters. how to load?

Answer Posted / vijay singh

LOAD DATA INFILE 'data.txt' INTO TABLE table2
FIELDS TERMINATED BY ',';

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I create a schema in mysql?

655


How does mysql encrypt passwords?

653


How to enable or disable a row of a table using MySQL in struts?

3813


How do I run mysql from command line?

711


What is a longblob?

692


Can mysql store files?

693


Where does mysql store data?

623


What is deterministic in mysql?

708


How do you insert a table?

666


What is myisamchk?

708


How can I remotely connect to mysql database?

669


Which datatype is used for email in mysql?

702


What mysql -u john -p command does?

706


What are the reasons for selecting lamp (linux, apache, mysql, php) instead of combination of other software programs, servers and operating systems?

780


How do you rename a procedure in mysql?

687