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 / vipul dalwala

LOAD DATA INFILE 'data.txt' INTO TABLE table_name
(city,code);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many rows can a mysql table hold?

674


What are the non-standard sql commands supported by 'mysql'?

701


Is mysql a server or database?

650


How to Creating a new user. Login as root. Switch to the MySQL db. Make the user. Update privs.

736


What is a procedure example?

667


What is pdo connection?

627


What is a simple query?

641


How can I compare two mysql databases?

643


Can you tell a way to know the number of days between the two given dates in php?

780


Where is mysql installed on linux?

673


How to calculate the difference between two dates?

710


What is pragma exception?

706


How do you determine the location of mysql data directory?

681


What you can use regular expression for in mysql? Support your answer with an example?

637


Where is the mysql data directory?

684