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?

Answers were Sorted based on User's Feedback



if we want to load data from a text file into a mysql table, but the columns in table are 1st: code..

Answer / vijay singh

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

Is This Answer Correct ?    3 Yes 0 No

if we want to load data from a text file into a mysql table, but the columns in table are 1st: code..

Answer / vipul dalwala

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

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More MySQL Interview Questions

What is striped backup

0 Answers   Cap Gemini,


How do I install mysql?

0 Answers  


What is mysql port?

0 Answers  


How to store binary data in mysql?

0 Answers  


How to analyze tables with 'mysqlcheck'?

0 Answers  


How would concatenate strings in mysql?

0 Answers  


What are mysql queries?

0 Answers  


What does mysql_fetch_assoc do?

0 Answers  


Can't connect mysql server on localhost?

0 Answers  


How do I use mysql?

0 Answers  


What is the purpose of mysql database?

0 Answers  


Give the syntax of GRANT commands?

3 Answers  


Categories