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 are mysql data types?

0 Answers  


What is the difference between primary key and candidate key?

0 Answers  


What mysql -u john -p command does?

0 Answers  


what is the querry for all managers salary?

2 Answers  


Where’s database data actually stored?

0 Answers  






What is the difference between unix timestamps and mysql timestamps?

0 Answers  


What is a join in mysql?

0 Answers  


What is dbms in mysql?

0 Answers  


What is a csv table?

0 Answers  


For the database from the previous question, please give an SQL query which returns the invoice number of all invoices which contain the article with the number ?1234?. The query should be able to run under a MySQL 4.0 database.

1 Answers  


What tools available for managing mysql server?

0 Answers  


How do I transfer data from one database to another in mysql?

0 Answers  


Categories