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

What is tee command in mysql?

465


Can we store images in mysql database?

458


Why is mysql popular?

468


Is sql similar to mysql?

462


What is processlist in mysql?

472






What is information_schema in mysql?

454


What is maximum table size in mysql?

464


How many columns is too many mysql?

454


What is mysql enterprise edition?

435


What are the types of index?

493


Where does mysql store data?

426


What are the different data types in mysql?

457


What is 'mysqlcheck'?

552


How can you make a database as your current database?

481


What is a blob datatype?

432