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 to determine the location of the data directory?

492


Is mysql a server or database?

465


Can not connect to mysql server 10060?

496


What is the use of mysqli_query?

441


How to check if value already exists in mysql database in php?

436






How do I completely remove mysql from windows?

441


What is myisam?

490


Transactions are used to treat sets of SQL statements atomically. State Whether True or False?

974


How do you use auto increment?

501


What is tee command in mysql?

478


What are the advantages of mysql?

527


Does mysql use t sql?

569


Why mysql is open source?

479


How many rows we can insert in a mysql table?

483


What is pragma serially_reusable and why is it used?

468